diff --git a/bindings/predeploys/addresses.go b/bindings/predeploys/addresses.go index f92d30f34..dc8a1b39b 100644 --- a/bindings/predeploys/addresses.go +++ b/bindings/predeploys/addresses.go @@ -29,7 +29,6 @@ const ( L2ReverseCustomGateway = "0x5300000000000000000000000000000000000018" L2WithdrawLockERC20Gateway = "0x5300000000000000000000000000000000000019" L2USDCGateway = "0x5300000000000000000000000000000000000020" - L2USDC = "0x5300000000000000000000000000000000000021" ) var ( @@ -57,7 +56,6 @@ var ( L2ReverseCustomGatewayAddr = common.HexToAddress(L2ReverseCustomGateway) L2WithdrawLockERC20GatewayAddr = common.HexToAddress(L2WithdrawLockERC20Gateway) L2USDCGatewayAddr = common.HexToAddress(L2USDCGateway) - L2USDCAddr = common.HexToAddress(L2USDC) Predeploys = make(map[string]*common.Address) ) @@ -87,5 +85,4 @@ func init() { Predeploys["L2ReverseCustomGateway"] = &L2ReverseCustomGatewayAddr Predeploys["L2WithdrawLockERC20Gateway"] = &L2WithdrawLockERC20GatewayAddr Predeploys["L2USDCGateway"] = &L2USDCGatewayAddr - Predeploys["L2USDC"] = &L2USDCAddr } diff --git a/contracts/deploy/013-DeployProxys.ts b/contracts/deploy/013-DeployProxys.ts index 3d39a9297..334cfe82d 100644 --- a/contracts/deploy/013-DeployProxys.ts +++ b/contracts/deploy/013-DeployProxys.ts @@ -63,8 +63,6 @@ export const deployContractProxies = async ( const WETHFactoryName = ContractFactoryName.WETH const WETHImplStorageName = ImplStorageName.WETH - const USDCFactoryName = ContractFactoryName.USDC - const USDCImplStorageName = ImplStorageName.USDC let err = "" // ************************ token contracts deploy ************************ @@ -93,41 +91,6 @@ export const deployContractProxies = async ( } } - if (config.l1USDCAddress == "") { - // L1WETH deploy - let Factory = await hre.ethers.getContractFactory(USDCFactoryName) - let contract = await Factory.deploy() - await contract.deployed() - console.log( - "%s=%s ; TX_HASH: %s", - USDCImplStorageName, - contract.address.toLocaleLowerCase(), - contract.deployTransaction.hash - ) - let blockNumber = await hre.ethers.provider.getBlockNumber() - console.log("BLOCK_NUMBER: %s", blockNumber) - err = await storage(path, USDCImplStorageName, contract.address.toLocaleLowerCase(), blockNumber || 0) - if (err != "") { - return err - } - await contract.initialize( - "USDC", - "USDC", - "USD", - 18, - config.contractAdmin, - config.contractAdmin, - config.contractAdmin, - config.contractAdmin - ) - } else { - let blockNumber = await hre.ethers.provider.getBlockNumber() - err = await storage(path, USDCImplStorageName, config.l1USDCAddress.toLocaleLowerCase(), blockNumber || 0) - if (err != "") { - return err - } - } - // ************************ messenger contracts deploy ************************ // L1CrossDomainMessengerProxy deploy err = await deployContractProxyByStorageName(hre, path, deployer, L1CrossDomainMessengerStorageName) diff --git a/contracts/deploy/014-DeployImpls.ts b/contracts/deploy/014-DeployImpls.ts index b149adf5f..06a58ef1d 100644 --- a/contracts/deploy/014-DeployImpls.ts +++ b/contracts/deploy/014-DeployImpls.ts @@ -36,7 +36,6 @@ export const deployContractImpls = async ( const L1ERC721GatewayFactoryName = ContractFactoryName.L1ERC721Gateway const L1ERC1155GatewayFactoryName = ContractFactoryName.L1ERC1155Gateway const L1WETHGatewayFactoryName = ContractFactoryName.L1WETHGateway - const L1USDCGatewayFactoryName = ContractFactoryName.L1USDCGateway const EnforcedTxGatewayFactoryName = ContractFactoryName.EnforcedTxGateway // implement storage name @@ -51,7 +50,6 @@ export const deployContractImpls = async ( const L1WithdrawLockERC20GatewayImplStorageName = ImplStorageName.L1WithdrawLockERC20GatewayStorageName const L1ReverseCustomGatewayImplStorageName = ImplStorageName.L1ReverseCustomGatewayStorageName const L1WETHGatewayImplStorageName = ImplStorageName.L1WETHGatewayStorageName - const L1USDCGatewayImplStorageName = ImplStorageName.L1USDCGatewayStorageName const L1ERC721GatewayImplStorageName = ImplStorageName.L1ERC721GatewayStorageName const L1ERC1155GatewayImplStorageName = ImplStorageName.L1ERC1155GatewayStorageName const WhitelistImplStorageName = ImplStorageName.Whitelist @@ -201,19 +199,6 @@ export const deployContractImpls = async ( return err } - // L1USDCGateway deploy - const L1USDCAddress = getContractAddressByName(path, ImplStorageName.USDC) - Factory = await hre.ethers.getContractFactory(L1USDCGatewayFactoryName) - contract = await Factory.deploy(L1USDCAddress, predeploys.L2USDC) - await contract.deployed() - console.log("%s=%s ; TX_HASH: %s", L1USDCGatewayImplStorageName, contract.address.toLocaleLowerCase(), contract.deployTransaction.hash) - blockNumber = await hre.ethers.provider.getBlockNumber() - console.log("BLOCK_NUMBER: %s", blockNumber) - err = await storage(path, L1USDCGatewayImplStorageName, contract.address.toLocaleLowerCase(), blockNumber || 0) - if (err != '') { - return err - } - // EnforcedTxGateway deploy Factory = await hre.ethers.getContractFactory(EnforcedTxGatewayFactoryName) contract = await Factory.deploy() diff --git a/contracts/deploy/017-GatewayInit.ts b/contracts/deploy/017-GatewayInit.ts index b5baeda31..8e3af686d 100644 --- a/contracts/deploy/017-GatewayInit.ts +++ b/contracts/deploy/017-GatewayInit.ts @@ -71,13 +71,6 @@ export const GatewayInit = async ( const WETHAddress = getContractAddressByName(path, ImplStorageName.WETH) - // L1USDCGateway config - const L1USDCGatewayProxyAddress = getContractAddressByName(path, ProxyStorageName.L1USDCGatewayProxyStorageName) - const L1USDCGatewayImplAddress = getContractAddressByName(path, ImplStorageName.L1USDCGatewayStorageName) - const L1USDCGatewayFactory = await hre.ethers.getContractFactory(ContractFactoryName.L1USDCGateway) - - const USDCAddress = getContractAddressByName(path, ImplStorageName.USDC) - // EnforcedTxGateway config const EnforcedTxGatewayProxyAddress = getContractAddressByName(path, ProxyStorageName.EnforcedTxGatewayProxyStorageName) const EnforcedTxGatewayImplAddress = getContractAddressByName(path, ImplStorageName.EnforcedTxGatewayStorageName) @@ -585,62 +578,6 @@ export const GatewayInit = async ( console.log('L1WETHGatewayProxy upgrade success') } - // L1USDCGatewayProxy init - const IL1USDCGatewayProxy = await hre.ethers.getContractAt(ContractFactoryName.DefaultProxyInterface, L1USDCGatewayProxyAddress, deployer) - if ( - (await IL1USDCGatewayProxy.implementation()).toLocaleLowerCase() !== L1USDCGatewayImplAddress.toLocaleLowerCase() - ) { - console.log('Upgrading the L1USDCGateway proxy...') - const counterpart: string = predeploys.L2USDCGateway - - if (!ethers.utils.isAddress(counterpart) - || !ethers.utils.isAddress(L1GatewayRouterProxyAddress) - || !ethers.utils.isAddress(L1CrossDomainMessengerProxyAddress) - ) { - console.error('please check your address') - return '' - } - // Upgrade and initialize the proxy. - await IL1USDCGatewayProxy.connect(deployer).upgradeToAndCall( - L1USDCGatewayImplAddress, - L1USDCGatewayFactory.interface.encodeFunctionData('initialize', [ - counterpart, - L1GatewayRouterProxyAddress, - L1CrossDomainMessengerProxyAddress - ]) - ) - await awaitCondition( - async () => { - return ( - (await IL1USDCGatewayProxy.implementation()).toLocaleLowerCase() === L1USDCGatewayImplAddress.toLocaleLowerCase() - ) - }, - 3000, - 1000 - ) - const contractTmp = new ethers.Contract( - L1USDCGatewayProxyAddress, - L1USDCGatewayFactory.interface, - deployer, - ) - await assertContractVariable( - contractTmp, - 'counterpart', - counterpart - ) - await assertContractVariable( - contractTmp, - 'router', - L1GatewayRouterProxyAddress - ) - await assertContractVariable( - contractTmp, - 'messenger', - L1CrossDomainMessengerProxyAddress - ) - console.log('L1USDCGatewayProxy upgrade success') - } - // IEnforcedTxGatewayProxy init const IEnforcedTxGatewayProxy = await hre.ethers.getContractAt(ContractFactoryName.DefaultProxyInterface, EnforcedTxGatewayProxyAddress, deployer) if ( diff --git a/contracts/deploy/019-AdminTransfer.ts b/contracts/deploy/019-AdminTransfer.ts index 3b3e34b90..bc36b11f8 100644 --- a/contracts/deploy/019-AdminTransfer.ts +++ b/contracts/deploy/019-AdminTransfer.ts @@ -26,13 +26,15 @@ export const AdminTransferByProxyStorageName = async ( const IProxyContract = await hre.ethers.getContractAt(ContractFactoryName.DefaultProxyInterface, ProxyAddr, deployer) { - const implAddr = (await IProxyContract.implementation()).toLocaleLowerCase() - const admin = (await IProxyContract.admin()).toLocaleLowerCase() - if (implAddr === EmptyContractImplAddr.toLocaleLowerCase()) { - return `Proxy implementation address ${implAddr} should not be empty contract address ${EmptyContractImplAddr}` - } - if (admin !== deployerAddr) { - return `Proxy admin address ${admin} should deployer address ${deployerAddr}` + if (storageName != ProxyStorageName.L1USDCGatewayProxyStorageName) { + const implAddr = (await IProxyContract.implementation()).toLocaleLowerCase() + const admin = (await IProxyContract.admin()).toLocaleLowerCase() + if (implAddr === EmptyContractImplAddr.toLocaleLowerCase()) { + return `Proxy implementation address ${implAddr} should not be empty contract address ${EmptyContractImplAddr}` + } + if (admin !== deployerAddr) { + return `Proxy admin address ${admin} should deployer address ${deployerAddr}` + } } } console.log(`change ${storageName} admin transfer from ${deployerAddr} to ProxyAdmin ${ProxyAdminImplAddr} `) diff --git a/contracts/deploy/020-ContractInit.ts b/contracts/deploy/020-ContractInit.ts index 598110d43..a0e17dc19 100644 --- a/contracts/deploy/020-ContractInit.ts +++ b/contracts/deploy/020-ContractInit.ts @@ -76,6 +76,7 @@ export const ContractInit = async ( const L1StakingProxyAddress = getContractAddressByName(path, ProxyStorageName.L1StakingProxyStorageName) const L1Staking = await hre.ethers.getContractAt(ContractFactoryName.L1Staking, L1StakingProxyAddress, deployer) const whiteListAdd = config.l2SequencerAddresses + console.log("Add sequencer address to white list ", config.l2SequencerAddresses) // set sequencer to white list await L1Staking.updateWhitelist(whiteListAdd, []) for (let i = 0; i < config.l2SequencerAddresses.length; i++) { @@ -96,23 +97,19 @@ export const ContractInit = async ( // ------------------ router init ----------------- { const L1WETHAddress = getContractAddressByName(path, ImplStorageName.WETH) - const L1USDCAddress = getContractAddressByName(path, ImplStorageName.USDC) - const L1WETHGatewayProxyAddress = getContractAddressByName(path, ProxyStorageName.L1WETHGatewayProxyStorageName) - const L1USDCGatewayProxyAddress = getContractAddressByName(path, ProxyStorageName.L1USDCGatewayProxyStorageName) const L1GatewayRouterProxyAddress = getContractAddressByName(path, ProxyStorageName.L1GatewayRouterProxyStorageName) const l1GatewayRouter = await hre.ethers.getContractAt(ContractFactoryName.L1GatewayRouter, L1GatewayRouterProxyAddress, deployer) // set token gateway - const tokens = [L1WETHAddress,L1USDCAddress] - const gateways = [L1WETHGatewayProxyAddress,L1USDCGatewayProxyAddress] + const tokens = [L1WETHAddress] + const gateways = [L1WETHGatewayProxyAddress] await l1GatewayRouter.setERC20Gateway(tokens, gateways) await awaitCondition( async () => { return ( - (await l1GatewayRouter.getERC20Gateway(L1WETHAddress)).toLocaleLowerCase() === L1WETHGatewayProxyAddress.toLocaleLowerCase() && - (await l1GatewayRouter.getERC20Gateway(L1USDCAddress)).toLocaleLowerCase() === L1USDCGatewayProxyAddress.toLocaleLowerCase() + (await l1GatewayRouter.getERC20Gateway(L1WETHAddress)).toLocaleLowerCase() === L1WETHGatewayProxyAddress.toLocaleLowerCase() ) }, 3000, diff --git a/contracts/src/constants.ts b/contracts/src/constants.ts index 1ea360479..dbebd35a9 100644 --- a/contracts/src/constants.ts +++ b/contracts/src/constants.ts @@ -25,5 +25,4 @@ export const predeploys = { L2ReverseERC20Gateway: "0x5300000000000000000000000000000000000018", L2WithdrawLockERC20Gateway: "0x5300000000000000000000000000000000000019", L2USDCGateway: "0x5300000000000000000000000000000000000020", - L2USDC: "0x5300000000000000000000000000000000000021", }; diff --git a/contracts/src/types.ts b/contracts/src/types.ts index af52d3bc1..ea2577c89 100644 --- a/contracts/src/types.ts +++ b/contracts/src/types.ts @@ -9,7 +9,6 @@ const ContractFactoryName = { // tokens WETH: 'WrappedEther', MockERC20: 'MockERC20', - USDC:'FiatTokenV1', // messenger L1CrossDomainMessenger: 'L1CrossDomainMessenger', L1MessageQueueWithGasPriceOracle: 'L1MessageQueueWithGasPriceOracle', @@ -63,7 +62,6 @@ const ImplStorageName = { EmptyContract: 'Impl__EmptyContract', // tokens WETH: 'Impl__WETH', - USDC: 'Impl__USDC', // messenger L1CrossDomainMessengerStorageName: 'Impl__L1CrossDomainMessenger', L1MessageQueueWithGasPriceOracle: 'Impl__L1MessageQueueWithGasPriceOracle', diff --git a/go-ethereum b/go-ethereum index 2f006c41c..e58ac01d1 160000 --- a/go-ethereum +++ b/go-ethereum @@ -1 +1 @@ -Subproject commit 2f006c41c9116bc339601834cd30ab1b7b64576a +Subproject commit e58ac01d16da31d9ca25a5e7e0e09bfdd352e76b diff --git a/ops/l2-genesis/morph-chain-ops/genesis/config.go b/ops/l2-genesis/morph-chain-ops/genesis/config.go index af05c2b69..9102c780e 100644 --- a/ops/l2-genesis/morph-chain-ops/genesis/config.go +++ b/ops/l2-genesis/morph-chain-ops/genesis/config.go @@ -76,14 +76,10 @@ type DeployConfig struct { L1ERC721GatewayProxy common.Address `json:"l1ERC721GatewayProxy"` // L1ERC1155Gateway proxy address on L1 L1ERC1155GatewayProxy common.Address `json:"l1ERC1155GatewayProxy"` - // L1USDCGatewayProxy proxy address on L1 - L1USDCGatewayProxy common.Address `json:"l1USDCGatewayProxy"` // L1WETHGatewayProxy proxy address on L1 L1WETHGatewayProxy common.Address `json:"l1WETHGatewayProxy"` // L1WETH address on L1 L1WETH common.Address `json:"l1WETH"` - // L1USDC address on L1 - L1USDC common.Address `json:"l1USDC"` // L1WithdrawLockERC20GatewayProxy proxy address on L1 L1WithdrawLockERC20Gateway common.Address `json:"l1WithdrawLockERC20Gateway"` @@ -224,14 +220,6 @@ func (d *DeployConfig) GetDeployedAddresses(hh *hardhat.Hardhat) error { d.L1WETHGatewayProxy = deployment.Address } - if d.L1USDCGatewayProxy == (common.Address{}) { - deployment, err := hh.GetDeployment("Proxy__L1USDCGateway") - if err != nil { - return err - } - d.L1USDCGatewayProxy = deployment.Address - } - if d.L1WETH == (common.Address{}) { deployment, err := hh.GetDeployment("Impl__WETH") if err != nil { @@ -240,14 +228,6 @@ func (d *DeployConfig) GetDeployedAddresses(hh *hardhat.Hardhat) error { d.L1WETH = deployment.Address } - if d.L1USDC == (common.Address{}) { - deployment, err := hh.GetDeployment("Impl__USDC") - if err != nil { - return err - } - d.L1USDC = deployment.Address - } - if d.L1WithdrawLockERC20Gateway == (common.Address{}) { deployment, err := hh.GetDeployment("Proxy__L1WithdrawLockERC20Gateway") if err != nil { @@ -341,48 +321,24 @@ func NewL2ImmutableConfig(config *DeployConfig) (immutables.ImmutableConfig, *im if config.L1WETHGatewayProxy == (common.Address{}) { return immutable, nil, fmt.Errorf("L1WETHGatewayProxy cannot be address(0): %w", ErrInvalidImmutablesConfig) } - if config.L1USDCGatewayProxy == (common.Address{}) { - return immutable, nil, fmt.Errorf("L1USDCGatewayProxy cannot be address(0): %w", ErrInvalidImmutablesConfig) - } if config.L1WithdrawLockERC20Gateway == (common.Address{}) { return immutable, nil, fmt.Errorf("L1WithdrawLockERC20Gateway cannot be address(0): %w", ErrInvalidImmutablesConfig) } if config.L1WETH == (common.Address{}) { return immutable, nil, fmt.Errorf("L1WETH cannot be address(0): %w", ErrInvalidImmutablesConfig) } - if config.L1USDC == (common.Address{}) { - return immutable, nil, fmt.Errorf("L1USDC cannot be address(0): %w", ErrInvalidImmutablesConfig) - } immutable["L2Staking"] = immutables.ImmutableValues{ "OTHER_STAKING": config.L1StakingProxy, } immutable["L2WETHGateway"] = immutables.ImmutableValues{ "l1WETH": config.L1WETH, } - immutable["L2USDCGateway"] = immutables.ImmutableValues{ - "l1USDC": config.L1USDC, - } blsKeys := make([][]byte, len(config.L2StakingBlsKeys)) for i, v := range config.L2StakingBlsKeys { blsKeys[i] = v } imConfig := &immutables.InitConfig{ - // L2USDC - USDCTokenName: "Bridged USDC", - USDCTokenSymbol: "USDC.e", - USDCTokenCurrency: "USD", - USDCTokenDecimals: 18, - USDCMasterMinter: config.FinalSystemOwner, - USDCPauser: config.FinalSystemOwner, - USDCBlackLister: config.FinalSystemOwner, - USDCOwner: config.FinalSystemOwner, - // MorphToken - //MorphTokenOwner: config.MorphTokenOwner, - //MorphTokenName: config.MorphTokenName, - //MorphTokenSymbol: config.MorphTokenSymbol, - //MorphTokenInitialSupply: config.MorphTokenInitialSupply, - //MorphTokenDailyInflationRate: config.MorphTokenDailyInflationRate, // L2Staking L2StakingOwner: config.FinalSystemOwner, L2StakingSequencersMaxSize: config.L2StakingSequencerMaxSize, @@ -588,15 +544,6 @@ func NewL2StorageConfig(config *DeployConfig, baseFee *big.Int) (state.StorageCo "router": predeploys.L2GatewayRouterAddr, "messenger": predeploys.L2CrossDomainMessengerAddr, } - storage["L2USDCGateway"] = state.StorageValues{ - "_status": 1, // ReentrancyGuard - "_initialized": 1, - "_initializing": false, - "_owner": config.FinalSystemOwner, - "counterpart": config.L1USDCGatewayProxy, - "router": predeploys.L2GatewayRouterAddr, - "messenger": predeploys.L2CrossDomainMessengerAddr, - } storage["L2WithdrawLockERC20Gateway"] = state.StorageValues{ "_status": 1, // ReentrancyGuard "_initialized": 1, @@ -628,17 +575,6 @@ func NewL2StorageConfig(config *DeployConfig, baseFee *big.Int) (state.StorageCo "_owner": predeploys.L2StandardERC20GatewayAddr, "implementation": predeploys.MorphStandardERC20Addr, } - storage["L2USDC"] = state.StorageValues{ - "initialized": true, - "name": "Bridged USDC", - "symbol": "USDC.e", - "currency": "USD", - "decimals": 18, - "masterMinter": config.FinalSystemOwner, - "pauser": config.FinalSystemOwner, - "blacklister": config.FinalSystemOwner, - "_owner": config.FinalSystemOwner, - } return storage, nil } diff --git a/ops/l2-genesis/morph-chain-ops/genesis/layer_two_test.go b/ops/l2-genesis/morph-chain-ops/genesis/layer_two_test.go index 782b6d4fb..8ce0e6ae8 100644 --- a/ops/l2-genesis/morph-chain-ops/genesis/layer_two_test.go +++ b/ops/l2-genesis/morph-chain-ops/genesis/layer_two_test.go @@ -37,8 +37,6 @@ func Test_BuildL2DeveloperGenesis(t *testing.T) { L1ERC1155GatewayProxy: address1, L1WETHGatewayProxy: address1, L1WETH: address1, - L1USDC: address1, - L1USDCGatewayProxy: address1, L1WithdrawLockERC20Gateway: address1, GasPriceOracleOverhead: 1, diff --git a/ops/l2-genesis/morph-chain-ops/genesis/setters.go b/ops/l2-genesis/morph-chain-ops/genesis/setters.go index 202def9a9..a41393383 100644 --- a/ops/l2-genesis/morph-chain-ops/genesis/setters.go +++ b/ops/l2-genesis/morph-chain-ops/genesis/setters.go @@ -82,7 +82,7 @@ func SetImplementations(db vm.StateDB, storage state.StorageConfig, immutable im return err } } else { - if name == "MorphToken" { + if name == "MorphToken" || name == "L2USDCGateway" { continue } err = SetTouchable(db, name, *address, storage, deployResults, slotResults) diff --git a/ops/l2-genesis/morph-chain-ops/immutables/config.go b/ops/l2-genesis/morph-chain-ops/immutables/config.go index d487a18b6..58f8af849 100644 --- a/ops/l2-genesis/morph-chain-ops/immutables/config.go +++ b/ops/l2-genesis/morph-chain-ops/immutables/config.go @@ -5,23 +5,6 @@ import ( ) type InitConfig struct { - // USDC - USDCTokenName string `json:"USDCTokenName"` - USDCTokenSymbol string `json:"USDCTokenSymbol"` - USDCTokenCurrency string `json:"USDCTokenCurrency"` - USDCTokenDecimals uint8 `json:"USDCTokenDecimals"` - USDCMasterMinter common.Address `json:"USDCTMasterMinter"` - USDCPauser common.Address `json:"USDCPauser"` - USDCBlackLister common.Address `json:"USDCBlackLister"` - USDCOwner common.Address `json:"USDCOwner"` - - // MorphToken - MorphTokenOwner common.Address `json:"morphTokenOwner"` - MorphTokenName string `json:"morphTokenName"` - MorphTokenSymbol string `json:"morphTokenSymbol"` - MorphTokenInitialSupply uint64 `json:"morphTokenInitialSupply"` - MorphTokenDailyInflationRate uint64 `json:"morphTokenDailyInflationRate"` - // L2Staking L2StakingOwner common.Address `json:"l2StakingOwner"` L2StakingSequencersMaxSize uint64 `json:"l2StakingSequencersMaxSize"` diff --git a/ops/l2-genesis/morph-chain-ops/immutables/immutables.go b/ops/l2-genesis/morph-chain-ops/immutables/immutables.go index 3af1f0df1..00faba3b3 100644 --- a/ops/l2-genesis/morph-chain-ops/immutables/immutables.go +++ b/ops/l2-genesis/morph-chain-ops/immutables/immutables.go @@ -2,10 +2,8 @@ package immutables import ( "context" - "errors" "fmt" "math/big" - "strconv" "github.com/morph-l2/go-ethereum/accounts/abi/bind" "github.com/morph-l2/go-ethereum/accounts/abi/bind/backends" @@ -100,9 +98,6 @@ func BuildMorph(immutable ImmutableConfig, config *InitConfig) (DeploymentResult { Name: "L2ERC1155Gateway", }, - //{ - // Name: "MorphToken", - //}, { Name: "MorphStandardERC20", }, @@ -121,15 +116,6 @@ func BuildMorph(immutable ImmutableConfig, config *InitConfig) (DeploymentResult { Name: "L2WETH", }, - { - Name: "L2USDCGateway", - Args: []interface{}{ - immutable["L2USDCGateway"]["l1USDC"], - }, - }, - { - Name: "L2USDC", - }, { Name: "ProxyAdmin", }, @@ -204,73 +190,6 @@ func BuildL2(constructors []deployer.Constructor, config *InitConfig) (Deploymen if err != nil { return nil, nil, err } - //case "MorphToken": - // if config == nil || config.MorphTokenName == "" { - // continue - // } - // morphToken, err := bindings.NewMorphToken(dep.Address, backend) - // if err != nil { - // return nil, nil, err - // } - // initSupply, success := new(big.Int).SetString(strconv.FormatUint(config.MorphTokenInitialSupply, 10)+"000000000000000000", 10) - // if !success { - // return nil, nil, errors.New("MorphTokenInitialSupply convert failed") - // } - // lastTx, err = morphToken.Initialize( - // opts, - // config.MorphTokenName, - // config.MorphTokenSymbol, - // config.MorphTokenOwner, - // initSupply, - // new(big.Int).SetUint64(config.MorphTokenDailyInflationRate), - // ) - // if err != nil { - // return nil, nil, err - // } - case "L2USDC": - if config == nil || config.USDCTokenName == "" { - continue - } - usdc, err := bindings.NewFiatTokenV1(dep.Address, backend) - if err != nil { - return nil, nil, err - } - lastTx, err = usdc.Initialize( - opts, - config.USDCTokenName, - config.USDCTokenSymbol, - config.USDCTokenCurrency, - config.USDCTokenDecimals, - opts.From, - config.USDCPauser, - config.USDCBlackLister, - opts.From, - ) - if err != nil { - return nil, nil, err - } - mintSupply, success := new(big.Int).SetString(strconv.FormatUint(1000000000, 10)+"000000000000000000", 10) - if !success { - return nil, nil, errors.New("USDC token mint Supply convert failed") - } - _, err = usdc.ConfigureMinter(opts, predeploys.L2USDCGatewayAddr, mintSupply) - if err != nil { - return nil, nil, err - } - _, err = usdc.UpdateMasterMinter(opts, config.USDCMasterMinter) - if err != nil { - return nil, nil, err - } - processTx, err := usdc.TransferOwnership(opts, config.USDCOwner) - if err != nil { - return nil, nil, err - } - backend.Commit() - if processTx != nil { - if _, err = bind.WaitMined(context.Background(), backend, processTx); err != nil { - return nil, nil, err - } - } default: } } @@ -334,8 +253,6 @@ func l2Deployer(backend *backends.SimulatedBackend, opts *bind.TransactOpts, dep _, tx, _, err = bindings.DeployL2ToL1MessagePasser(opts, backend) case "L2TxFeeVault": _, tx, _, err = bindings.DeployL2TxFeeVault(opts, backend, common.BigToAddress(common.Big1), common.BigToAddress(common.Big1), common.Big0) - //case "MorphToken": - // _, tx, _, err = bindings.DeployMorphToken(opts, backend) case "MorphStandardERC20": _, tx, _, err = bindings.DeployMorphStandardERC20(opts, backend) case "MorphStandardERC20Factory": @@ -362,14 +279,6 @@ func l2Deployer(backend *backends.SimulatedBackend, opts *bind.TransactOpts, dep _, tx, _, err = bindings.DeployL2WETHGateway(opts, backend, predeploys.L2WETHAddr, l1weth) case "L2WithdrawLockERC20Gateway": _, tx, _, err = bindings.DeployL2WithdrawLockERC20Gateway(opts, backend) - case "L2USDCGateway": - l1usdc, ok := deployment.Args[0].(common.Address) - if !ok { - return nil, fmt.Errorf("invalid type for l1usdc") - } - _, tx, _, err = bindings.DeployL2USDCGateway(opts, backend, l1usdc, predeploys.L2USDCAddr) - case "L2USDC": - _, tx, _, err = bindings.DeployFiatTokenV1(opts, backend) case "L2WETH": _, tx, _, err = bindings.DeployWrappedEther(opts, backend) case "ProxyAdmin":