BevmStack Bridge is the system contract of BevmStack Chain and is an important component for the decentralization of Bitcoin assets to the BevmStack chain.
BevmStack Bridge is implemented using UUPS proxy pattern
nodejs
:v22.6.0
foundry
:v0.2.0
forge-std
:v1.9.2
openzeppelin-foundry-upgrades
:v0.3.2
openzeppelin-contracts-upgradeable
:v5.0.2
reset PRIVATE_KEY
cp .env-example .env
vi .env
forge script ./script/Deploy.s.sol --broadcast -vvvv --rpc-url $RPC_URL
Based on the execution results of the previous step,
Deploy.s.sol
will set BRIDGE_PROXY
and BRIDGE_IMPL
to .env
file.
verify the contracts
source .env
forge verify-contract --verifier blockscout --verifier-url $VERIFIER_URL $BRIDGE_PROXY lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Proxy.sol:ERC1967Proxy --skip-is-verified-check --chain $CHAIN_ID
forge verify-contract --verifier blockscout --verifier-url $VERIFIER_URL $BRIDGE_IMPL src/BridgeV6Proxiable.sol:BridgeV6Proxiable --chain $CHAIN_ID
The upgrade of the BevmStack Bridge
is governed by BevmStack's council
vote.
The council
need to call xAssetsBridge->callContract
to build an unsigned evm transaction(from
is the system account 0x1111111111111111111111111111111111111111
).
forge script PrepareUpgradeScript --broadcast -vvvv --rpc-url $RPC_URL
Based on the execution results of the previous step,
PrepareUpgradeScript.s.sol
will set NEW_BRIDGE_IMPL
and UPGRADE_CALLDATA
to .env
file.
- The
contract
ofxAssetsBridge->callContract
isBRIDGE_PROXY
. - The
inputs
ofxAssetsBridge->callContract
isUPGRADE_CALLDATA
.
verify the contracts
source .env
forge verify-contract --verifier blockscout --verifier-url $VERIFIER_URL $NEW_BRIDGE_IMPL src/BridgeV7TestProxiable.sol:BridgeV7TestProxiable --chain $CHAIN_ID
- issue:
Build info file ${buildInfoFilePath} is not from a full compilation.
resolved: runforge clean
and rerun forge script