Skip to content

Commit 3c49c93

Browse files
committed
chore: Bober testnet deployment for V2-migration debugging
1 parent 55aeaa5 commit 3c49c93

12 files changed

Lines changed: 9524 additions & 0 deletions

File tree

constants/tokenConfig.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,15 @@ const tokens = {
120120
requiredDVNs: [LZ],
121121
},
122122
},
123+
BoberProxyOFT: {
124+
address: "0x16f001514C5953Bd6505D3007F58DE1Ca496de12",
125+
withFee: true,
126+
sendConfig: {
127+
...ULN,
128+
confirmations: 1,
129+
requiredDVNs: [LZ],
130+
},
131+
},
123132
},
124133
ethereum: {
125134
BeamProxyOFT: {
@@ -213,6 +222,16 @@ const tokens = {
213222
symbol: "BEAM",
214223
withFee: true,
215224
},
225+
BoberOFT: {
226+
name: "Bober",
227+
symbol: "BOB",
228+
withFee: true,
229+
sendConfig: {
230+
...ULN,
231+
confirmations: 1,
232+
requiredDVNs: [LZ],
233+
},
234+
},
216235
},
217236
arbitrum: {
218237
GobProxyOFT: {

contracts/contracts-upgradable/examples/OFTPermit.sol

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,7 @@ contract GoldOFT is OFTWithFeePermitUpgradeable {
5353
}
5454

5555
contract GoldProxyOFT is ProxyOFTWithFeeUpgradeable {}
56+
57+
contract BoberOFT is OFTWithFeePermitUpgradeable {}
58+
59+
contract BoberProxyOFT is ProxyOFTWithFeeUpgradeable {}

deploy/BoberOFT.js

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
const LZ_ENDPOINTS = require("../constants/layerzeroEndpoints.json")
2+
const TOKEN_CONFIG = require("../constants/tokenConfig")
3+
4+
const CONTRACT_NAME = "BoberOFT"
5+
6+
module.exports = async function ({ deployments, getNamedAccounts }) {
7+
const { deploy } = deployments
8+
const { deployer, proxyOwner } = await getNamedAccounts()
9+
10+
let lzEndpointAddress, lzEndpoint, LZEndpointMock
11+
if (hre.network.name === "hardhat") {
12+
LZEndpointMock = await ethers.getContractFactory("LZEndpointMock")
13+
lzEndpoint = await LZEndpointMock.deploy(1)
14+
lzEndpointAddress = lzEndpoint.address
15+
} else {
16+
lzEndpointAddress = LZ_ENDPOINTS[hre.network.name]
17+
}
18+
19+
const tokenConfig = TOKEN_CONFIG[hre.network.name][CONTRACT_NAME]
20+
if (!tokenConfig.name || !tokenConfig.symbol) {
21+
console.error("No configuration found for target network.")
22+
return
23+
}
24+
25+
await deploy(CONTRACT_NAME, {
26+
from: deployer,
27+
log: true,
28+
waitConfirmations: 1,
29+
proxy: {
30+
owner: proxyOwner,
31+
proxyContract: "OptimizedTransparentProxy",
32+
execute: {
33+
init: {
34+
methodName: "initialize",
35+
args: [
36+
tokenConfig.name,
37+
tokenConfig.symbol,
38+
tokenConfig.sharedDecimals != null ? tokenConfig.sharedDecimals : 6,
39+
lzEndpointAddress,
40+
],
41+
},
42+
},
43+
},
44+
})
45+
}
46+
47+
module.exports.tags = [CONTRACT_NAME]

deploy/BoberProxyOFT.js

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
const LZ_ENDPOINTS = require("../constants/layerzeroEndpoints.json")
2+
const TOKEN_CONFIG = require("../constants/tokenConfig")
3+
4+
const CONTRACT_NAME = "BoberProxyOFT"
5+
6+
module.exports = async function ({ deployments, getNamedAccounts }) {
7+
const { deploy } = deployments
8+
const { deployer, proxyOwner } = await getNamedAccounts()
9+
10+
let lzEndpointAddress, lzEndpoint, LZEndpointMock
11+
if (hre.network.name === "hardhat") {
12+
LZEndpointMock = await ethers.getContractFactory("LZEndpointMock")
13+
lzEndpoint = await LZEndpointMock.deploy(1)
14+
lzEndpointAddress = lzEndpoint.address
15+
} else {
16+
lzEndpointAddress = LZ_ENDPOINTS[hre.network.name]
17+
}
18+
19+
const tokenConfig = TOKEN_CONFIG[hre.network.name][CONTRACT_NAME]
20+
21+
if (!tokenConfig.address) {
22+
console.error("No configured token address found for target network.")
23+
return
24+
}
25+
26+
await deploy(CONTRACT_NAME, {
27+
from: deployer,
28+
log: true,
29+
waitConfirmations: 1,
30+
proxy: {
31+
owner: proxyOwner,
32+
proxyContract: "OptimizedTransparentProxy",
33+
execute: {
34+
init: {
35+
methodName: "initialize",
36+
args: [tokenConfig.address, tokenConfig.sharedDecimals != null ? tokenConfig.sharedDecimals : 6, lzEndpointAddress],
37+
},
38+
},
39+
},
40+
})
41+
}
42+
43+
module.exports.tags = [CONTRACT_NAME]

0 commit comments

Comments
 (0)