feat: add guarded Base Sepolia encore
This commit is contained in:
+13
-5
@@ -11,6 +11,12 @@ contract DeployV1 is DemoScript {
|
||||
_requireSupportedChain(block.chainid);
|
||||
_printEducationalWarning();
|
||||
address sender = vm.envAddress("SCRIPT_SENDER");
|
||||
address recipient;
|
||||
string memory publicRpcUrl;
|
||||
|
||||
if (block.chainid == BASE_SEPOLIA_CHAIN_ID) {
|
||||
(, recipient, publicRpcUrl) = _requireBaseConfig(sender);
|
||||
}
|
||||
|
||||
if (block.chainid == ANVIL_CHAIN_ID) {
|
||||
(uint256 ownerKey, address derivedOwner) = _deriveLocalActor(block.chainid, 0);
|
||||
@@ -40,17 +46,18 @@ contract DeployV1 is DemoScript {
|
||||
manifest.network = block.chainid == ANVIL_CHAIN_ID ? "anvil" : "baseSepolia";
|
||||
manifest.chainId = block.chainid;
|
||||
manifest.deploymentBlock = 0;
|
||||
manifest.rpcUrl = block.chainid == ANVIL_CHAIN_ID ? "http://127.0.0.1:8545" : "";
|
||||
manifest.rpcUrl = block.chainid == ANVIL_CHAIN_ID ? "http://127.0.0.1:8545" : publicRpcUrl;
|
||||
manifest.explorerBaseUrl = block.chainid == BASE_SEPOLIA_CHAIN_ID ? "https://sepolia.basescan.org" : "";
|
||||
manifest.token = tokenAddress;
|
||||
manifest.proxy = proxy;
|
||||
manifest.implementation = implementation;
|
||||
manifest.owner = sender;
|
||||
manifest.actors = _actors(sender);
|
||||
manifest.actors = _actors(sender, recipient);
|
||||
|
||||
_writeManifest(_manifestPath(PENDING_MANIFEST_PATH), manifest);
|
||||
}
|
||||
|
||||
function _actors(address sender) private view returns (Actor[] memory actors) {
|
||||
function _actors(address sender, address recipient) private view returns (Actor[] memory actors) {
|
||||
if (block.chainid == ANVIL_CHAIN_ID) {
|
||||
actors = new Actor[](3);
|
||||
actors[0] = Actor({label: "owner", address_: sender});
|
||||
@@ -59,8 +66,9 @@ contract DeployV1 is DemoScript {
|
||||
actors[1].label = "Alice";
|
||||
actors[2].label = "Bob";
|
||||
} else {
|
||||
actors = new Actor[](1);
|
||||
actors[0] = Actor({label: "owner", address_: sender});
|
||||
actors = new Actor[](2);
|
||||
actors[0] = Actor({label: "Presenter", address_: sender});
|
||||
actors[1] = Actor({label: "Recipient", address_: recipient});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user