Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
cloud8little committed Oct 10, 2024
1 parent 5ce90be commit 61a5da3
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 12 deletions.
20 changes: 10 additions & 10 deletions script/13_DepositValidator.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,16 @@ contract DepositScript is BaseScript {
_loadValidatorContainer();
_loadValidatorProof();

if (!useExocorePrecompileMock) {
_bindPrecompileMocks();
}

// transfer some gas fee to depositor, relayer and exocore gateway
clientChain = vm.createSelectFork(clientChainRPCURL);
_topUpPlayer(clientChain, address(0), deployer, depositor.addr, 0.2 ether);

exocore = vm.createSelectFork(exocoreRPCURL);
_topUpPlayer(exocore, address(0), exocoreGenesis, address(exocoreGateway), 1 ether);

if (!useExocorePrecompileMock) {
_bindPrecompileMocks();
}
}

function run() public {
Expand Down Expand Up @@ -89,25 +89,25 @@ contract DepositScript is BaseScript {
}

function _loadValidatorContainer() internal {
string memory validatorInfo = vm.readFile("script/validator_container_proof_1711400.json");
string memory validatorInfo = vm.readFile("script/validatorProof_staker1_testnetV6.json");

validatorContainer = stdJson.readBytes32Array(validatorInfo, ".ValidatorFields");
validatorContainer = stdJson.readBytes32Array(validatorInfo, ".validatorContainer");
require(validatorContainer.length > 0, "validator container should not be empty");
}

function _loadValidatorProof() internal {
string memory validatorInfo = vm.readFile("script/validator_container_proof_1711400.json");
string memory validatorInfo = vm.readFile("script/validatorProof_staker1_testnetV6.json");

uint256 slot = stdJson.readUint(validatorInfo, ".slot");
validatorProof.beaconBlockTimestamp = GENESIS_BLOCK_TIMESTAMP + SECONDS_PER_SLOT * slot;

validatorProof.stateRoot = stdJson.readBytes32(validatorInfo, ".beaconStateRoot");
validatorProof.stateRoot = stdJson.readBytes32(validatorInfo, ".stateRoot");
require(validatorProof.stateRoot != bytes32(0), "state root should not be empty");
validatorProof.stateRootProof =
stdJson.readBytes32Array(validatorInfo, ".StateRootAgainstLatestBlockHeaderProof");
stdJson.readBytes32Array(validatorInfo, ".stateRootProof");
require(validatorProof.stateRootProof.length == 3, "state root proof should have 3 nodes");
validatorProof.validatorContainerRootProof =
stdJson.readBytes32Array(validatorInfo, ".WithdrawalCredentialProof");
stdJson.readBytes32Array(validatorInfo, ".validatorContainerProof");
require(validatorProof.validatorContainerRootProof.length == 46, "validator root proof should have 46 nodes");
validatorProof.validatorIndex = stdJson.readUint(validatorInfo, ".validatorIndex");
require(validatorProof.validatorIndex != 0, "validator root index should not be 0");
Expand Down
6 changes: 4 additions & 2 deletions script/3_Setup.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ contract SetupScript is BaseScript {
decimals[1] = 18;
names[1] = "StakedETH";
metaDatas[1] = "natively staked ETH on Ethereum";
oracleInfos[1] = "ETH,Ethereum,8"; //[tokenName],[chainName],[tokenDecimal](,[interval],[contract](,[ChainDesc:{...}],[TokenDesc:{...}]))
oracleInfos[1] = "ETH,Ethereum,8"; //[tokenName],[chainName],[tokenDecimal](,[interval],[contract](,[ChainDesc:{...}],[TokenDesc:{...}]))
tvlLimits[1] = 0; // irrelevant for native restaking

// second add whitelist tokens and their meta data on Exocore side to enable LST Restaking and Native Restaking,
Expand All @@ -121,7 +121,9 @@ contract SetupScript is BaseScript {
for (uint256 i = 0; i < whitelistTokensBytes32.length; i++) {
nativeFee = exocoreGateway.quote(
clientChainId,
abi.encodePacked(Action.REQUEST_ADD_WHITELIST_TOKEN, abi.encodePacked(whitelistTokensBytes32[i],tvlLimits[i]))
abi.encodePacked(
Action.REQUEST_ADD_WHITELIST_TOKEN, abi.encodePacked(whitelistTokensBytes32[i], tvlLimits[i])
)
);
exocoreGateway.addWhitelistToken{value: nativeFee}(
clientChainId,
Expand Down
68 changes: 68 additions & 0 deletions script/validatorProof_staker1_testnetV6.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"slot": 2720312,
"validatorIndex": 1819867,
"stateRoot": "0xd23d2167739b9ce63139d87d60c0a3e47778bfd33eb78f2e5b2f824a87de284b",
"stateRootProof": [
"0xeb5cea3bc3bfa00d3fd8211e396d9fd5fca13a275b4e05d260709d49a9a7e6d5",
"0x6245ea08950aad0dde501c031d16997d1e89e4603e3d4a19c3b37526011de0cf",
"0x98f59e15e3bd559f928f2352bd3cc8d6c17ae1ef0d6d376a1de0987fd0ea17ed"
],
"validatorContainer": [
"0x24a871b6c5c01f37dfaf7a30bc8194ec3305f78022aaccb80743db150d1f2de1",
"0x010000000000000000000000f6df11416f870ed14353c53dcad40ae01a78e875",
"0x0040597307000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0xe74b010000000000000000000000000000000000000000000000000000000000",
"0xed4b010000000000000000000000000000000000000000000000000000000000",
"0xffffffffffffffff000000000000000000000000000000000000000000000000",
"0xffffffffffffffff000000000000000000000000000000000000000000000000"
],
"validatorContainerProof": [
"0x99dba25d4884f7a8dda327fc6551d078c2cbacef7e0371e49f60ee1aab1924cb",
"0x48592ea6e6bba67718164ceb162a941441be530fe1240ed08f398ff4d61522af",
"0x94a4e7de0a842dc3beb367d62d394a012afd462af988ac2c19697ca530d73ffe",
"0x5eda3c016614e3d0b9f5b09c0d8e6bc1d6084da2bda0cd1c532d27cefbba5cab",
"0xd447a4f77d660a7a5c0222a577b61adae203b6705016c9cd7b174fe2013cebb7",
"0x0433670bf77202ea835f6c0369a2dfe529853808cc73aefd36e4d4f8840b484c",
"0xbed181dd01444228505e043fff6279c83d3dc7e057a068b182f8029104763a62",
"0xc4c4c02eed6273ff658e672d671bd9dee993a990229da4caad7f43ea83a981c5",
"0xb2b2d661d89fbe40f5099a27065acaf1b11cd092fe9349a5a3ade222b4afcce5",
"0x506d86582d252405b840018792cad2bf1259f1ef5aa5f887e13cb2f0094f51e1",
"0x66c3b82b785bc755cc54fb2e9f2ba024b9aa724dabe9f88c19760b10bec2e5d9",
"0x6cf04127db05441cd833107a52be852868890e4317e6a02ab47683aa75964220",
"0xb7d05f875f140027ef5118a2247bbb84ce8f2f0f1123623085daf7960c329f5f",
"0xdf6af5f5bbdb6be9ef8aa618e4bf8073960867171e29676f8b284dea6a08a85e",
"0x820f39b715fdf3e5efe8d08b67ddd6af8b516439beefa51905fb7e3c39949cda",
"0xe3ba2e312a445c5cf666804b29f979992109f11688b2bc9e527e87ac62cb5df8",
"0xe8a886addaeff05ce9f71e5e7753b368597b14eac84cf27d3e6ee238e511c368",
"0x4ccbe8988177d82682fa008c567c97efa58d63fd42bf1c984ab9f28f2e7e9341",
"0x95eec8b2e541cad4e91de38385f2e046619f54496c2382cb6cacd5b98c26f5a4",
"0xf62f086caf09c65f1f326b780361a0ee4572defedca572adb00977827f872df6",
"0x16cf8325d06b477ad53348b29d22fc0ec7dfca1aa5751569c8450d21ade40c21",
"0x8a8d7fe3af8caa085a7639a832001457dfb9128a8061142ad0335629ff23ff9c",
"0xfeb3c337d7a51a6fbf00b9e34c52e1c9195c969bd4e7a0bfd51d5c5bed9c1167",
"0xe71f0aa83cc32edfbefa9f4d3e0174ca85182eec9f3a09f6a6c0df6377a510d7",
"0x31206fa80a50bb6abe29085058f16212212a60eec8f049fecb92d8c8e0a84bc0",
"0x21352bfecbeddde993839f614c3dac0a3ee37543f9b412b16199dc158e23b544",
"0x619e312724bb6d7c3153ed9de791d764a366b389af13c58bf8a8d90481a46765",
"0x7cdd2986268250628d0c10e385c58c6191e6fbe05191bcc04f133f2cea72c1c4",
"0x848930bd7ba8cac54661072113fb278869e07bb8587f91392933374d017bcbe1",
"0x8869ff2c22b28cc10510d9853292803328be4fb0e80495e8bb8d271f5b889636",
"0xb5fe28e79f1b850f8658246ce9b6a1e7b49fc06db7143e8fe0b4f2b0c5523a5c",
"0x985e929f70af28d0bdd1a90a808f977f597c7c778c489e98d3bd8910d31ac0f7",
"0xc6f67e02e6e4e1bdefb994c6098953f34636ba2b6ca20a4721d2b26a886722ff",
"0x1c9a7e5ff1cf48b4ad1582d3f4e4a1004f3b20d8c5a2b71387a4254ad933ebc5",
"0x2f075ae229646b6f6aed19a5e372cf295081401eb893ff599b3f9acc0c0d3e7d",
"0x328921deb59612076801e8cd61592107b5c67c79b846595cc6320c395b46362c",
"0xbfb909fdb236ad2411b4e4883810a074b840464689986c3f8a8091827e17c327",
"0x55d8fb3687ba3ba49f342c77f5a1f89bec83d811446e1a467139213d640b6a74",
"0xf7210d4f8e7e1039790e7bf4efa207555a10a6db1dd4b95da313aaa88b88fe76",
"0xad21b516cbc645ffe34ab5de1c8aef8cd4e7f8d2b51e8e1456adc7563cda206f",
"0x44c51b0000000000000000000000000000000000000000000000000000000000",
"0x04df050000000000000000000000000000000000000000000000000000000000",
"0x8446dcc6f0e908bb31d3b47ef0ab8198f87d2a7386718a087346dbb06ad7eb70",
"0x4382f67ee646f56303e3195b5af1af4bc105bf316bcc48c05cf34a033c7863b6",
"0xf085ae5e7b501886a9ba9e01210e0f7ff08d717b330297dfbb5b2108d2b5ee7c",
"0xed87fe31599a69b3cdb14b7d722e97caf17bc1f6af2e6801a372927f0158bffd"
]
}

0 comments on commit 61a5da3

Please sign in to comment.