Skip to content

Commit 2fc553b

Browse files
update contracts with new owners
1 parent 3209331 commit 2fc553b

5 files changed

Lines changed: 13 additions & 13 deletions

script/EnsoCCIPReceiverDeployer.s.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
pragma solidity ^0.8.28;
33

44
import { EnsoCCIPReceiver } from "../src/bridge/EnsoCCIPReceiver.sol";
5-
import { ChainId } from "../src/libraries/DataTypes.sol";
5+
import { ChainId, ChainOwner } from "../src/libraries/ChainOwner.sol";
66
import { Script } from "forge-std/Script.sol";
77

88
contract EnsoCCIPReceiverDeployer is Script {
@@ -14,7 +14,7 @@ contract EnsoCCIPReceiverDeployer is Script {
1414
function run() public returns (address ensoCcipReceiver, address owner, address ccipRouter, address ensoRouter) {
1515
uint256 chainId = block.chainid;
1616

17-
owner = vm.envAddress("DEPLOYER_ADDRESS"); // NOTE: owner is deployer
17+
owner = ChainOwner.ownerFor(chainId);
1818
if (chainId == ChainId.ETHEREUM) {
1919
ccipRouter = 0x80226fc0Ee2b096224EeAc085Bb9a8cba1146f7D;
2020
ensoRouter = 0xF75584eF6673aD213a685a1B58Cc0330B8eA22Cf;

script/EnsoReceiverAndPaymasterDeployer.s.sol

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,30 @@ pragma solidity ^0.8.28;
33

44
import { EnsoReceiver } from "../src/delegate/EnsoReceiver.sol";
55
import { ERC4337CloneFactory } from "../src/factory/ERC4337CloneFactory.sol";
6+
import { ChainOwner } from "../src/libraries/ChainOwner.sol";
67
import { SignaturePaymaster } from "../src/paymaster/SignaturePaymaster.sol";
78
import { IEntryPoint } from "account-abstraction-v7/interfaces/IEntryPoint.sol";
89
import { Script } from "forge-std/Script.sol";
910

1011
contract EnsoReceiverAndPaymasterDeployer is Script {
1112
address ENTRY_POINT_V7 = 0x0000000071727De22E5E9d8BAf0edAc6f37da032;
12-
13-
address OWNER = 0x826e0BB2276271eFdF2a500597f37b94f6c153bA;
14-
address BACKEND_SIGNER = 0xFE503EE14863F6aCEE10BCdc66aC5e2301b3A946;
13+
address BACKEND_SIGNER = 0x89B3c70f6dF4Fc6Ba0613de208c9da5132b8ecc2;
1514

1615
function run()
1716
public
1817
returns (EnsoReceiver implementation, ERC4337CloneFactory factory, SignaturePaymaster paymaster)
1918
{
2019
vm.startBroadcast();
2120

21+
address owner = ChainOwner.ownerFor(block.chainid);
22+
address deployer = msg.sender;
2223
address entryPoint = ENTRY_POINT_V7;
2324
implementation = new EnsoReceiver{ salt: "EnsoReceiver" }();
2425
implementation.initialize(address(0), address(0), address(0)); // brick the implementation
2526
factory = new ERC4337CloneFactory{ salt: "ERC4337CloneFactory" }(address(implementation), entryPoint);
26-
paymaster = new SignaturePaymaster{ salt: "SignaturePaymaster" }(IEntryPoint(entryPoint), OWNER);
27+
paymaster = new SignaturePaymaster{ salt: "SignaturePaymaster" }(IEntryPoint(entryPoint), deployer);
2728
paymaster.setSigner(BACKEND_SIGNER, true);
29+
paymaster.transferOwnership(owner);
2830

2931
vm.stopBroadcast();
3032
}

script/EnsoReceiverDeployer.s.sol

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ import { Script } from "forge-std/Script.sol";
99
contract EnsoReceiverDeployer is Script {
1010
address ENTRY_POINT_V7 = 0x0000000071727De22E5E9d8BAf0edAc6f37da032;
1111

12-
address OWNER = 0x826e0BB2276271eFdF2a500597f37b94f6c153bA;
13-
address BACKEND_SIGNER = 0xFE503EE14863F6aCEE10BCdc66aC5e2301b3A946;
14-
1512
function run() public returns (EnsoReceiver implementation, ERC4337CloneFactory factory) {
1613
vm.startBroadcast();
1714

script/FlashloanAdapterDeployer.s.sol

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ pragma solidity ^0.8.28;
44
import { EnsoRouterFlashloanAdapter } from "../src/flashloan/EnsoRouterFlashloanAdapter.sol";
55
import { EnsoSafeFlashloanAdapter } from "../src/flashloan/EnsoSafeFlashloanAdapter.sol";
66
import { EnsoWalletFlashloanAdapter } from "../src/flashloan/EnsoWalletFlashloanAdapter.sol";
7+
import { ChainOwner } from "../src/libraries/ChainOwner.sol";
78
import { FlashloanAdapterConfig, LenderProtocol } from "./FlashloanAdapterConfig.s.sol";
89
import { Script } from "forge-std/Script.sol";
910

@@ -27,7 +28,7 @@ contract EnsoWalletFlashloanAdapterDeployer is Script, FlashloanAdapterConfig {
2728

2829
vm.startBroadcast();
2930

30-
address owner = vm.envAddress("DEPLOYER_ADDRESS");
31+
address owner = ChainOwner.ownerFor(block.chainid);
3132

3233
if (router != address(0)) {
3334
routerAdapter =

script/LayerZeroDeployer.s.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
pragma solidity ^0.8.28;
33

44
import { LayerZeroReceiver } from "../src/bridge/LayerZeroReceiver.sol";
5-
import { ChainId } from "../src/libraries/DataTypes.sol";
5+
import { ChainId, ChainOwner } from "../src/libraries/ChainOwner.sol";
66
import { Script } from "forge-std/Script.sol";
77

88
contract LayerZeroDeployer is Script {
99
function run() public returns (address lzReceiver, address endpoint, address router) {
1010
vm.startBroadcast();
1111

12-
address deployer = 0x826e0BB2276271eFdF2a500597f37b94f6c153bA;
1312
uint256 chainId = block.chainid;
13+
address owner = ChainOwner.ownerFor(chainId);
1414
if (chainId == ChainId.ZKSYNC) {
1515
endpoint = 0xd07C30aF3Ff30D96BDc9c6044958230Eb797DDBF; // zksync
1616
router = 0x1BD8CefD703CF6b8fF886AD2E32653C32bc62b5C;
@@ -55,7 +55,7 @@ contract LayerZeroDeployer is Script {
5555
router = 0xF75584eF6673aD213a685a1B58Cc0330B8eA22Cf;
5656
}
5757

58-
lzReceiver = address(new LayerZeroReceiver{ salt: "LayerZeroReceiver" }(endpoint, router, deployer));
58+
lzReceiver = address(new LayerZeroReceiver{ salt: "LayerZeroReceiver" }(endpoint, router, owner));
5959

6060
vm.stopBroadcast();
6161
}

0 commit comments

Comments
 (0)