evm: clean up deployment script (#24)

Co-authored-by: gator-boi <gator-boi@users.noreply.github.com>
This commit is contained in:
Reptile 2023-02-21 14:51:12 -05:00 committed by GitHub
parent 565d4abdfa
commit 9572867afc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 11 deletions

View File

@ -27,7 +27,7 @@ export RELEASE_WORMHOLE_ADDRESS=0x
export RELEASE_CIRCLE_BRIDGE_ADDRESS=0x
# Circle Message Transmitter Address
export RELEASE_MESSAGE_TRANSMITTER_ADDRESS=0x
export RELEASE_WORMHOLE_FINALITY=
```
Then run the following command to deploy (and set up) the proxy contract:

View File

@ -13,12 +13,11 @@ import {IMessageTransmitter} from "../src/interfaces/circle/IMessageTransmitter.
import {CircleIntegrationSetup} from "../src/circle_integration/CircleIntegrationSetup.sol";
import {CircleIntegrationImplementation} from "../src/circle_integration/CircleIntegrationImplementation.sol";
import {CircleIntegrationProxy} from "../src/circle_integration/CircleIntegrationProxy.sol";
import {WormholeSimulator} from "wormhole-forge-sdk/WormholeSimulator.sol";
import {ICircleIntegration} from "../src/interfaces/ICircleIntegration.sol";
contract ContractScript is Script {
// Wormhole
WormholeSimulator wormholeSimulator;
IWormhole wormhole;
// Circle
ICircleBridge circleBridge;
@ -30,8 +29,7 @@ contract ContractScript is Script {
function setUp() public {
// Wormhole
wormholeSimulator = wormholeSimulator = new WormholeSimulator(
vm.envAddress("RELEASE_WORMHOLE_ADDRESS"), 0);
wormhole = IWormhole(vm.envAddress("RELEASE_WORMHOLE_ADDRESS"));
// Circle
circleBridge = ICircleBridge(vm.envAddress("RELEASE_CIRCLE_BRIDGE_ADDRESS"));
@ -44,17 +42,19 @@ contract ContractScript is Script {
// next Implementation
implementation = new CircleIntegrationImplementation();
console.log("Wormhole address: %s, chainId: %s", address(wormhole), wormhole.chainId());
// setup Proxy using Implementation
proxy = new CircleIntegrationProxy(
address(setup),
abi.encodeWithSelector(
bytes4(keccak256("setup(address,address,uint8,address,uint16,bytes32)")),
address(implementation),
address(wormholeSimulator.wormhole()),
uint8(1), // finality
address(wormhole),
uint8(vm.envUint("RELEASE_WORMHOLE_FINALITY")),
address(circleBridge),
wormholeSimulator.governanceChainId(),
wormholeSimulator.governanceContract()
wormhole.governanceChainId(),
wormhole.governanceContract()
)
);
}

View File

@ -21,7 +21,7 @@ contract CircleIntegration is CircleIntegrationMessages, CircleIntegrationGovern
using BytesLib for bytes;
/**
* @notice Emitted when Circle-support assets have been minted to the mintRecipient
* @notice Emitted when Circle-supported assets have been minted to the mintRecipient
* @param emitterChainId Wormhole chain ID of emitter contract on source chain
* @param emitterAddress Address (bytes32 zero-left-padded) of emitter on source chain
* @param sequence Sequence of Wormhole message used to mint tokens