Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cross chain BASE deployment scenario #674

Closed
36 tasks done
dimpar opened this issue Jul 28, 2023 · 0 comments
Closed
36 tasks done

Cross chain BASE deployment scenario #674

dimpar opened this issue Jul 28, 2023 · 0 comments
Assignees
Labels
:shipit: deployment Deployments and CI workflows

Comments

@dimpar
Copy link
Contributor

dimpar commented Jul 28, 2023

Refs PR #673

Team Address
Deployment Team 0x123694886DBf5Ac94DDA07135349534536D14cAf
Threshold Council 0x518385dd31289F1000fE6382b0C65df4d1Cd3bfC

Package preparation

  • Make sure @keep-network/tbtc-v2 points to the latest version v1.5.0 containing L2TBTC code and L2WormholeGateway code and the existing mainnet deployment artifacts.
  • Change the package version of @keep-network/tbtc-v2-base to 1.0.0

Base ETH on BASE

As of today the bridging of ETH is not supported on BASE mainnet. This bridge url https://bridge.base.org/ redirects to goerli bridge. However, there is a workaround through their proxy contract. Step by step is also described on Base Discord

1️⃣ Add a network to your wallet
https://docs.base.org/network-information
2️⃣ Only send ethereum mainnet eth to this address 0x49048044D57e1C92A77f79988d21Fa8fAF74E97e  0.001ETH should be enough).
3️⃣ Switch to base mainnet, go to(https://basescan.org/verifiedSignatures#) connect wallet, click 'Sign Messages', insert: all your base belong to you. (Start with a end with . ) - click Sign, copy the Signature Hash.
4️⃣ In basescan (https://basescan.org/address/0x1fc10ef15e041c5d3c54042e52eb0c54cb9b710c#writeContract) connect wallet "Connect to Web3", go to section 2 mint, insert Signature Hash and press Write. 
If everything is correct, the commission is around 0.3-06$, if you are wrong with the message, there will be an error of overcharged gas.
5️⃣ Transaction mint look in basescan (https://basescan.org/)
  • Fund the Deployment Team account with Base ETH on BASE to cover the deployment fees (L2 tx: [0xb451da328c348251a52450bb1ffdf7968dccffc10ff925d2a3e089f9b7646e50](https://basescan.org/tx/0xb451da328c348251a52450bb1ffdf7968dccffc10ff925d2a3e089f9b7646e50))

Attest token

  • Register tBTC token on BASE (L1 tx: [0x2df8d53251aff96b6341f3fffda03b46ff04c35edb8dff496962da73d19c04c7](https://etherscan.io/tx/0x2df8d53251aff96b6341f3fffda03b46ff04c35edb8dff496962da73d19c04c7), L2 tx: [0x82af9e68b6be7db6b89cfb6e09368f524e04a317c938e367047f6467484e47a3](https://basescan.org/tx/0x82af9e68b6be7db6b89cfb6e09368f524e04a317c938e367047f6467484e47a3))
  • Confirm wormhole tBTC token address on BASE (address: 0x9ee95e6bd1b3c5740f105d6fb06b8bdef64eec70 )

Smart contracts

The Deployment Team does all the steps. We should execute scripts from 00-15 without transferring ownership to Council. Use tags that are in the deployment scripts.

  • Deploy L2TBTC (proxy contract address: 0x236aa50979D5f3De3Bd1Eeb40E81137F22ab794b; implementation contract address: 0x41C9b5639E3F2F6C61e9B78b2c6FF3746E79d91A)
  • Initialize L2TBTC contract (tx: 0x85f05786bb1d38013714332804139352f16aa2751d05b4517ed2f7e67d683a6a) with the following parameters:
    • name: Base tBTC v2
    • symbol: tBTC
  • Deploy L2WormholeGateway (proxy contract address: 0x09959798B95d00a3183d20FaC298E4594E599eab; implementation contract address: 0x292C9fdf2e2475599cBe350cc473c221Bd67AE28)
  • Initialize BaseWormholeGateway contract (tx: 0xa1f899fbe911303fd9202727a1c1613317b086a603ba780174eb8dde19919a79) with the following parameters:
    • _bridge: 0x8d2de8d2f73F1F4cAB472AC9A881C9b123C79627
    • _bridgeToken: BaseWormholeTBTC.address // registered address given in step 4 in Portal
    • _tbtc: BaseTBTC.address
  • Authorize BaseWormholeGateway as a minter of L2 canonicaltBTC token (tx: 0xff95b6245239db9036266de3dcbae12a5decb04b340cfc3319030a56b1cd2495)
  • Set BaseWormholeGateway self-reference using updateGatewayAddress (tx: 0x5e3c5bb2c94d951186211b8ada4dd7dbabd06706aa9c304204c1cefd6c83bd5d)
  • Set ArbitrumWormholeGateway with address: 0x1293a54e160D1cd7075487898d65266081A15458 using updateGatewayAddress (tx: 0x15e809b3e73eb0b1e0fd58d1aa62fb7831103399cb3979edd9f91824178b1a22)
  • Set OptimismWormholeGateway with address: 0x1293a54e160D1cd7075487898d65266081A15458 using updateGatewayAddress (tx: 0x67980b401e05f00e6e2745c9dc1fc02cf2814b81fed6ad5bf319455b114d7ef6)
  • Set PolygonWormholeGateway with address: 0x09959798B95d00a3183d20FaC298E4594E599eab using updateGatewayAddress (tx: 0x7723e006fbed907bf4364bf337d8aa4e4574cf86413ec872f9f5c7a00ec43c0e)

Base Ethereum verification

The Deployment Team does all the steps. Verification should be processed automatically as part of the deployment scripts.

  • Verify BaseTBTC contract
  • Verify BaseWormholeGateway contract

Tag the new version

The Deployment Team does all the steps

  • Create releases/mainnet/cross-chain/base/v1.0.0 release branch
  • Pin mainnet versions in cross-chain/base/package.json
  • Tag cross-chain/base/v1.0.0
  • Sign cross-chain/base/v1.0.0 commit hash

The following steps should be done after the mainnet smoke testing (Ethereum-Base) is done and no issues are reported.

Update other chains with BaseWormholeGateway address and chain id.

This will need to be executed by the Threshold Council because they have ownership of the contracts. We should give them JSONs to load into Safe. Navigate to tx builder and prepare JSON for each chain:

Arbitrum transaction JSON executing 'updateGatewayAddress()' with Base chain ID: 30
  
  {
    "version": "1.0",
    "chainId": "42161",
    "createdAt": 1691398774087,
    "meta":
    {
        "name": "Transactions Batch",
        "description": "",
        "txBuilderVersion": "1.16.1",
        "createdFromSafeAddress": "0x9F6e831c8F8939DC0C830C6e492e7cEf4f9C2F5f",
        "createdFromOwnerAddress": "",
        "checksum": "0x67abfd0201533920e2aae92babdea1117cd2611f6b781b331c64da00183ce74c"
    },
    "transactions":
    [
        {
            "to": "0x1293a54e160D1cd7075487898d65266081A15458",
            "value": "0",
            "data": null,
            "contractMethod":
            {
                "inputs":
                [
                    {
                        "internalType": "uint16",
                        "name": "chainId",
                        "type": "uint16"
                    },
                    {
                        "internalType": "bytes32",
                        "name": "gateway",
                        "type": "bytes32"
                    }
                ],
                "name": "updateGatewayAddress",
                "payable": false
            },
            "contractInputsValues":
            {
                "chainId": "30",
                "gateway": "0x00000000000000000000000009959798B95d00a3183d20FaC298E4594E599eab"
            }
        }
    ]
}
Optimism transaction JSON executing 'updateGatewayAddress()' with Base chain ID: 30
  
  {
    "version": "1.0",
    "chainId": "10",
    "createdAt": 1691401045293,
    "meta":
    {
        "name": "Transactions Batch",
        "description": "",
        "txBuilderVersion": "1.16.1",
        "createdFromSafeAddress": "0x7fB50BBabeDEE52b8760Ba15c0c199aF33Fc2EfA",
        "createdFromOwnerAddress": "",
        "checksum": "0x78c22ce3a40361ca3e6ebb6bbf66ce80a79102be7431da3908f46498f621d01c"
    },
    "transactions":
    [
        {
            "to": "0x1293a54e160D1cd7075487898d65266081A15458",
            "value": "0",
            "data": null,
            "contractMethod":
            {
                "inputs":
                [
                    {
                        "internalType": "uint16",
                        "name": "chainId",
                        "type": "uint16"
                    },
                    {
                        "internalType": "bytes32",
                        "name": "gateway",
                        "type": "bytes32"
                    }
                ],
                "name": "updateGatewayAddress",
                "payable": false
            },
            "contractInputsValues":
            {
                "chainId": "30",
                "gateway": "0x00000000000000000000000009959798B95d00a3183d20FaC298E4594E599eab"
            }
        }
    ]
}
Polygon transaction JSON executing 'updateGatewayAddress()' with Base chain ID: 30
{
    "version": "1.0",
    "chainId": "137",
    "createdAt": 1691401562254,
    "meta":
    {
        "name": "Transactions Batch",
        "description": "",
        "txBuilderVersion": "1.16.1",
        "createdFromSafeAddress": "0x9F6e831c8F8939DC0C830C6e492e7cEf4f9C2F5f",
        "createdFromOwnerAddress": "",
        "checksum": "0xc0b8429e5a07027ca6d3c73a5785231116135b383203e8e77699bec1f690d836"
    },
    "transactions":
    [
        {
            "to": "0x09959798B95d00a3183d20FaC298E4594E599eab",
            "value": "0",
            "data": null,
            "contractMethod":
            {
                "inputs":
                [
                    {
                        "internalType": "uint16",
                        "name": "chainId",
                        "type": "uint16"
                    },
                    {
                        "internalType": "bytes32",
                        "name": "gateway",
                        "type": "bytes32"
                    }
                ],
                "name": "updateGatewayAddress",
                "payable": false
            },
            "contractInputsValues":
            {
                "chainId": "30",
                "gateway": "0x00000000000000000000000009959798B95d00a3183d20FaC298E4594E599eab"
            }
        }
    ]
}

Safe instruction screenshot

Screenshot 2023-07-28 at 14 01 04

JS/TS code for padding Ethereum address to 32 bytes

ethers.utils.hexZeroPad(hex, 32)


The following steps should be done after the rest of mainnet testing is done including Ethereum, Arbitrum, Optimism, and Polygon.

Transfer ownership to Threshold Council

  • Transfer BaseTBTC ownership (tx: 0x227ce033f9f22a198671629e69fa3e56f83fdb74e332dfafd3ee1a10af3687bd)
  • Transfer BaseWormholeGateway ownership (tx: 0x90cba0a1e82a5493e466f17a8c53a17690f32e855e059c2fbfc099cf056b1afb)
  • Transfer ProxyAdmin ownership (tx: 0x08c0140702d5e925fdcd82d9f656b6ea6addd229fbba3f45a877516efa5d2ba1)

Package publication

Done by the Deployment Team

  • Publish cross-chain/base/v1.0.0 package to NPM
  • Publish release notes for cross-chain/base/v1.0.0

Push deployment artifacts to version control

  • Push deployment artifacts to releases/mainnet/cross-chain/base/v1.0.0 release branch
  • Cherry-pick deployment artifacts to the main branch

Post-deployment

  • Bump up version in cross-chain/base/package.json to v1.1.0-dev

Important!!! Register BaseTBTC in Base repo by Aug 3rd

Register as Base Genesis Builder

Register Base tBTC on Wormhole Token List

Update Threshold docs with new Base addresses.

@erdogan erdogan closed this as completed Aug 17, 2023
@pdyraga pdyraga added the :shipit: deployment Deployments and CI workflows label Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:shipit: deployment Deployments and CI workflows
Projects
None yet
Development

No branches or pull requests

4 participants