Skip to content

Commit edfab49

Browse files
authored
Merge branch 'release' into arb_native_token
2 parents 4d15b51 + f5a54d6 commit edfab49

6 files changed

Lines changed: 83 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ on:
1010
- master
1111
- develop
1212
- release
13+
# run this job on the default branch daily
14+
# the docker compose file contains some images with tags like 'latest' and 'stable'
15+
# we nightly run here just to double check no bugs have been merged into those tags and are now on release
16+
schedule:
17+
- cron: '0 0 * * *'
1318

1419
jobs:
1520
build_and_run:

boldupgrader/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ RUN git checkout ${BOLD_CONTRACTS_BRANCH}
88
RUN yarn install && yarn cache clean
99
RUN curl -L https://foundry.paradigm.xyz | bash
1010
ENV PATH="${PATH}:/root/.foundry/bin"
11-
RUN foundryup
11+
RUN foundryup --install 1.0.0
1212
RUN touch scripts/config.ts
1313
RUN yarn build:all
1414
ENTRYPOINT ["yarn"]

rollupcreator/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ RUN git checkout ${NITRO_CONTRACTS_BRANCH}
88
RUN yarn install && yarn cache clean
99
RUN curl -L https://foundry.paradigm.xyz | bash
1010
ENV PATH="${PATH}:/root/.foundry/bin"
11-
RUN foundryup
11+
RUN foundryup --install 1.0.0
1212
RUN touch scripts/config.ts
1313
RUN yarn build:all
1414
ENTRYPOINT ["yarn"]

scripts/ethcommands.ts

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,41 @@ async function deployERC20Contract(deployerWallet: Wallet, decimals: number): Pr
142142
return token.address;
143143
}
144144

145+
async function deployFeeTokenPricerContract(deployerWallet: Wallet, exchangeRate: BigNumber): Promise<string> {
146+
//// Bytecode below is generated from this simple FeeTokenPricer contract
147+
148+
// pragma solidity ^0.8.16;
149+
150+
// interface IFeeTokenPricer {
151+
// /**
152+
// * @notice Get the number of child chain's fee tokens per 1 parent chain's native token. Exchange rate must be
153+
// * denominated in 18 decimals.
154+
// * @dev For example, parent chain's native token is ETH, fee token is DAI. If price of 1ETH = 2000DAI, then function should return 2000*1e18.
155+
// * If fee token is USDC instead and price of 1ETH = 2000USDC, function should still return 2000*1e18, no matter that USDC uses 6 decimals.
156+
// */
157+
// function getExchangeRate() external returns (uint256);
158+
// }
159+
160+
// contract ConstantFeeTokenPricer is IFeeTokenPricer {
161+
// uint256 immutable public constExchangeRate;
162+
// constructor(uint256 _constExchangeRate) {
163+
// constExchangeRate = _constExchangeRate;
164+
// }
165+
166+
// function getExchangeRate() external view returns (uint256) {
167+
// return constExchangeRate;
168+
// }
169+
// }
170+
171+
const feeTokenPricerBytecode = "0x60a0604052348015600e575f80fd5b506040516101c63803806101c68339818101604052810190602e9190606d565b8060808181525050506093565b5f80fd5b5f819050919050565b604f81603f565b81146058575f80fd5b50565b5f815190506067816048565b92915050565b5f60208284031215607f57607e603b565b5b5f608a84828501605b565b91505092915050565b6080516101166100b05f395f8181606a0152608f01526101165ff3fe6080604052348015600e575f80fd5b50600436106030575f3560e01c8063b8910a29146034578063e6aa216c14604e575b5f80fd5b603a6068565b6040516045919060c9565b60405180910390f35b6054608c565b604051605f919060c9565b60405180910390f35b7f000000000000000000000000000000000000000000000000000000000000000081565b5f7f0000000000000000000000000000000000000000000000000000000000000000905090565b5f819050919050565b60c38160b3565b82525050565b5f60208201905060da5f83018460bc565b9291505056fea2646970667358221220ee17f22614d853ccf8b3f854137f68f06ff92f9f71ba8b811d78b1313eead0c564736f6c634300081a0033";
172+
const abi = ["constructor(uint256 exchangeRate)"];
173+
const feeTokenPricerFactory = new ContractFactory(abi, feeTokenPricerBytecode, deployerWallet);
174+
const feeTokenPricer = await feeTokenPricerFactory.deploy(exchangeRate);
175+
await feeTokenPricer.deployTransaction.wait();
176+
177+
return feeTokenPricer.address;
178+
}
179+
145180
async function deployWETHContract(deployerWallet: Wallet): Promise<string> {
146181
const wethFactory = new ContractFactory(TestWETH9.abi, TestWETH9.bytecode, deployerWallet);
147182
const weth = await wethFactory.deploy("Wrapped Ether", "WETH");
@@ -385,6 +420,30 @@ export const createERC20Command = {
385420
},
386421
};
387422

423+
export const createFeeTokenPricerCommand = {
424+
command: "create-fee-token-pricer",
425+
describe: "creates Constant Fee Token Pricer on L2",
426+
builder: {
427+
deployer: {
428+
string: true,
429+
describe: "account (see general help)"
430+
},
431+
},
432+
handler: async (argv: any) => {
433+
console.log("create-fee-token-pricer");
434+
435+
argv.provider = new ethers.providers.WebSocketProvider(argv.l2url);
436+
const deployerWallet = new Wallet(
437+
ethers.utils.sha256(ethers.utils.toUtf8Bytes(argv.deployer)),
438+
argv.provider
439+
);
440+
const feeTokenPricerAddress = await deployFeeTokenPricerContract(deployerWallet, BigNumber.from("15000000000000000000"));
441+
console.log("Contract deployed at address:", feeTokenPricerAddress);
442+
443+
argv.provider.destroy();
444+
},
445+
};
446+
388447
export const deployExpressLaneAuctionContractCommand = {
389448
command: "deploy-express-lane-auction",
390449
describe: "Deploy the ExpressLaneAuction contract",

scripts/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import {
3434
setValidKeysetCommand,
3535
waitForSyncCommand,
3636
transferL3ChainOwnershipCommand,
37+
createFeeTokenPricerCommand,
3738
} from "./ethcommands";
3839

3940
async function main() {
@@ -52,6 +53,7 @@ async function main() {
5253
.command(bridgeToL3Command)
5354
.command(bridgeNativeTokenToL3Command)
5455
.command(createERC20Command)
56+
.command(createFeeTokenPricerCommand)
5557
.command(deployExpressLaneAuctionContractCommand)
5658
.command(createWETHCommand)
5759
.command(transferERC20Command)

test-node.bash

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
set -eu
44

5-
NITRO_NODE_VERSION=offchainlabs/nitro-node:v3.5.3-rc.3-653b078
5+
NITRO_NODE_VERSION=offchainlabs/nitro-node:v3.5.5-90ee45c
66
BLOCKSCOUT_VERSION=offchainlabs/blockscout:v1.1.0-0e716c8
77

88
DEFAULT_NITRO_CONTRACTS_VERSION="v2.1.1-beta.0"
@@ -52,6 +52,7 @@ consensusclient=false
5252
boldupgrade=false
5353
redundantsequencers=0
5454
l3_custom_fee_token=false
55+
l3_custom_fee_token_pricer=false
5556
l3_token_bridge=false
5657
l3_custom_fee_token_decimals=18
5758
batchposters=1
@@ -232,6 +233,14 @@ while [[ $# -gt 0 ]]; do
232233
l3_custom_fee_token=true
233234
shift
234235
;;
236+
--l3-fee-token-pricer)
237+
if ! $l3_custom_fee_token; then
238+
echo "Error: --l3-fee-token-pricer requires --l3-fee-token to be provided."
239+
exit 1
240+
fi
241+
l3_custom_fee_token_pricer=true
242+
shift
243+
;;
235244
--l3-fee-token-decimals)
236245
if ! $l3_custom_fee_token; then
237246
echo "Error: --l3-fee-token-decimals requires --l3-fee-token to be provided."
@@ -627,6 +636,11 @@ if $force_init; then
627636
docker compose run scripts transfer-erc20 --token $nativeTokenAddress --amount 10000 --from user_fee_token_deployer --to l3owner
628637
docker compose run scripts transfer-erc20 --token $nativeTokenAddress --amount 10000 --from user_fee_token_deployer --to user_token_bridge_deployer
629638
EXTRA_L3_DEPLOY_FLAG="-e FEE_TOKEN_ADDRESS=$nativeTokenAddress"
639+
if $l3_custom_fee_token_pricer; then
640+
echo == Deploying custom fee token pricer
641+
feeTokenPricerAddress=`docker compose run scripts create-fee-token-pricer --deployer user_fee_token_deployer | tail -n 1 | awk '{ print $NF }'`
642+
EXTRA_L3_DEPLOY_FLAG="$EXTRA_L3_DEPLOY_FLAG -e FEE_TOKEN_PRICER_ADDRESS=$feeTokenPricerAddress"
643+
fi
630644
fi
631645

632646
echo == Deploying L3

0 commit comments

Comments
 (0)