Skip to content

Commit

Permalink
fix(ci): correct the address names and keys (ExocoreNetwork#137)
Browse files Browse the repository at this point in the history
* fix(ci): require reward vault deployment

* fix(ci): update keys in deployment

* fix(ci): add address validation
  • Loading branch information
MaxMustermann2 authored Dec 31, 2024
1 parent 321a7e2 commit 47a9a15
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 5 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/forge-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,61 @@ jobs:
- name: Check formatting
run: forge fmt --check

check-contract-deployments:
# Takes less than 30s
timeout-minutes: 5
runs-on: ubuntu-latest
needs: build
steps:
- name: Restore cached Foundry toolchain
uses: actions/cache/restore@v3
with:
path: ${{ needs.build.outputs.installation-dir }}
key: ${{ needs.build.outputs.cache-key }}
- name: Add Foundry to PATH
run: echo "${{ needs.build.outputs.installation-dir }}" >> "$GITHUB_PATH"
- name: Checkout repository
uses: actions/checkout@v4
- name: Validate deployedContracts.json
run: |
data=$(cat script/deployedContracts.json)
bootstrap=$(echo "$data" | jq -r '.clientChain.bootstrapLogic // empty')
clientGateway=$(echo "$data" | jq -r '.clientChain.clientGatewayLogic // empty')
vault=$(echo "$data" | jq -r '.clientChain.vaultImplementation // empty')
rewardVault=$(echo "$data" | jq -r '.clientChain.rewardVaultImplementation // empty')
capsule=$(echo "$data" | jq -r '.clientChain.capsuleImplementation // empty')
validate_address() {
local address=$1
if [ -z "$address" ]; then
echo "Validation failed: Address is empty"
exit 1
fi
if [ "$(cast 2a $address)" != "$address" ]; then
echo "Validation failed: $address is not a valid Ethereum checksum address"
exit 1
fi
}
# Check each address
echo "Validating bootstrap address..."
validate_address "$bootstrap"
echo "Validating clientGateway address..."
validate_address "$clientGateway"
echo "Validating vault address..."
validate_address "$vault"
echo "Validating rewardVault address..."
validate_address "$rewardVault"
echo "Validating capsule address..."
validate_address "$capsule"
echo "Validation passed: All fields are non-empty and valid Ethereum checksum addresses"
extract-base-storage-layout-exocore-gateway:
# Takes less than 30 seconds, but add some margin for git clone
timeout-minutes: 10
Expand Down
3 changes: 1 addition & 2 deletions script/compareLayouts.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ const fileMappings = [
{ before: 'Bootstrap.deployed.json', after: 'Bootstrap.compiled.json', mustExist: true },
{ before: 'ClientChainGateway.deployed.json', after: 'ClientChainGateway.compiled.json', mustExist: true },
{ before: 'Vault.deployed.json', after: 'Vault.compiled.json', mustExist: true },
// TODO: once RewardVault is deployed, change mustExist to true
{ before: 'RewardVault.deployed.json', after: 'RewardVault.compiled.json', mustExist: false },
{ before: 'RewardVault.deployed.json', after: 'RewardVault.compiled.json', mustExist: true },
{ before: 'ExoCapsule.deployed.json', after: 'ExoCapsule.compiled.json', mustExist: true },
{ before: 'ExocoreGateway.base.json', after: 'ExocoreGateway.compiled.json', mustExist: true },
{ before: 'Bootstrap.compiled.json', after: 'ClientChainGateway.compiled.json', mustExist: true },
Expand Down
8 changes: 5 additions & 3 deletions script/deployedContracts.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@
"clientChain": {
"beaconOracle": "0xd3D285cd1516038dAED61B8BF7Ae2daD63662492",
"beaconProxyBytecode": "0xA15Ce26ba8E50ac21ecDa1791BAa3bf22a95b575",
"bootstrap": "0xDf9caDCfb027d9f6264Ecd5eAEc839a8335d8520",
"bootstrapLogic": "0xB97A39004Ba6900FAE801Ac04F8ce4DA70689879",
"capsuleBeacon": "0xB8D032a30a3B950CBcc6c1689E2381ab4290D4BB",
"capsuleImplementation": "0x8638502De2001e0dF71BbB5dd503E2008b2Ae948",
"clientChainGateway": "0xDf9caDCfb027d9f6264Ecd5eAEc839a8335d8520",
"clientChainGatewayLogic": "0x92A645a44DFf3e5499F9e6A1d6738520971267AA",
"clientGatewayLogic": "0x92A645a44DFf3e5499F9e6A1d6738520971267AA",
"lzEndpoint": "0x6EDCE65403992e310A62460808c4b910D972f10f",
"proxyAdmin": "0x4317A7f62dA871E4512424Df8CaE91A6Ccc2afEA",
"rewardVaultBeacon": "0xEe75FF2f3A6E49a7cfd0aa2F729563F8c0F7707b",
"rewardVaultImplementation": "0xAE4Aed8C1A66f89D7c19D7B1021BE027846A51e6",
"vaultBeacon": "0x737e311Bf34B838943A30110289C5a9b22eba2A8",
"vaultImplementation": "0xce7f4AC8D00f5e4aB3BEd9fDD1EDB9cD20516477"
"vaultImplementation": "0xce7f4AC8D00f5e4aB3BEd9fDD1EDB9cD20516477",
"wstETH": "0xB82381A3fBD3FaFA77B3a7bE693342618240067b"
},
"exocore": {
"exocoreGateway": "0xEAf4E4D09b9CeB936492518A852026c914beb11E",
Expand Down

0 comments on commit 47a9a15

Please sign in to comment.