-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add relay deposit script, deploy new token gateway (#266)
- Loading branch information
Showing
11 changed files
with
649 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'@fuel-bridge/solidity-contracts': minor | ||
'@fuel-bridge/test-utils': minor | ||
--- | ||
|
||
Add relay deposit script |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
packages/solidity-contracts/deploy/devnet/016.erc20_gateway_v4.redeployment.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import type { HardhatRuntimeEnvironment } from 'hardhat/types'; | ||
import type { DeployFunction } from 'hardhat-deploy/dist/types'; | ||
|
||
import { FuelERC20GatewayV4__factory as FuelERC20Gateway } from '../../typechain'; | ||
|
||
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { | ||
const { | ||
ethers, | ||
upgrades: { deployProxy, erc1967 }, | ||
deployments: { get, save }, | ||
} = hre; | ||
const [deployer] = await ethers.getSigners(); | ||
|
||
const fuelMessagePortal = await get('FuelMessagePortal'); | ||
|
||
const contract = await deployProxy( | ||
new FuelERC20Gateway(deployer), | ||
[fuelMessagePortal.address], | ||
{ | ||
initializer: 'initialize', | ||
} | ||
); | ||
await contract.waitForDeployment(); | ||
|
||
const address = await contract.getAddress(); | ||
const implementation = await erc1967.getImplementationAddress(address); | ||
|
||
console.log('Deployed FuelERC20GatewayV4 at', address); | ||
await save('FuelERC20GatewayV4', { | ||
address, | ||
abi: [...FuelERC20Gateway.abi], | ||
implementation, | ||
}); | ||
|
||
return true; | ||
}; | ||
|
||
func.tags = ['gateway_redeploy']; | ||
func.id = 'gateway_redeploy'; | ||
export default func; |
32 changes: 32 additions & 0 deletions
32
packages/solidity-contracts/deploy/devnet/017.configure_l2_issuer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import type { HardhatRuntimeEnvironment } from 'hardhat/types'; | ||
import type { DeployFunction } from 'hardhat-deploy/dist/types'; | ||
|
||
const ASSET_ISSUER_PROXY_ID = | ||
'0x12f300d6d2b286dd5d290b709e0d3d73acc23c87ec10d349d4386b9524d740a1'; | ||
|
||
const ASSET_ISSUER_IMPL_ID = | ||
'0x191f58253e324d85e66bdd20bf3d2d0ff55f0189e71387498783b07997c9a854'; | ||
|
||
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { | ||
const { ethers, deployments } = hre; | ||
const [deployer] = await ethers.getSigners(); | ||
|
||
await deployments.execute( | ||
'FuelERC20GatewayV4', | ||
{ log: true, from: deployer.address }, | ||
'setAssetIssuerId', | ||
ASSET_ISSUER_PROXY_ID | ||
); | ||
|
||
await deployments.save('FuelL2BridgeId', { | ||
address: ASSET_ISSUER_PROXY_ID, | ||
abi: [], | ||
implementation: ASSET_ISSUER_IMPL_ID, | ||
}); | ||
|
||
return true; | ||
}; | ||
|
||
func.tags = ['set_asset_issuer_redeploy']; | ||
func.id = 'set_asset_issuer_redeploy'; | ||
export default func; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.