Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: DeployExpressLaneAuctionScript #31

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"@arbitrum/nitro-contracts-1.2.1": "npm:@arbitrum/[email protected]",
"@arbitrum/nitro-contracts-1.3.0": "npm:@arbitrum/[email protected]",
"@arbitrum/nitro-contracts-2.1.0": "npm:@arbitrum/[email protected]",
"@arbitrum/nitro-contracts-2.1.1": "npm:@arbitrum/[email protected]",
"@arbitrum/token-bridge-1.2.2": "npm:@arbitrum/[email protected]",
"@nomicfoundation/hardhat-chai-matchers": "^2.0.0",
"@nomicfoundation/hardhat-ethers": "^3.0.0",
Expand Down
16 changes: 16 additions & 0 deletions scripts/foundry/timeboost/.env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## These env vars are used for DeployExpressLaneAuction.s.sol
PROXY_ADMIN_ADDRESS=
AUCTIONEER_ADDRESS=
BIDDING_TOKEN_ADDRESS=
BENEFICIARY_ADDRESS=
AUCTIONEER_ADMIN_ADDRESS=
MIN_RESERVE_PRICE_SETTER_ADDRESS=
RESERVE_PRICE_SETTER_ADDRESS=
RESERVE_PRICE_SETTER_ADMIN_ADDRESS=
BENEFICIARY_SETTER_ADDRESS=
ROUND_TIMING_SETTER_ADDRESS=
MASTER_ADMIN_ADDRESS=

ROUND_DURATION_SECONDS=60
AUCTION_CLOSING_SECONDS=15
RESERVE_SUBMISSION_SECONDS=15
55 changes: 55 additions & 0 deletions scripts/foundry/timeboost/DeployExpressLaneAuction.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity 0.8.16;

import {DeploymentHelpersScript} from "../helper/DeploymentHelpers.s.sol";
import {TransparentUpgradeableProxy} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";

import "@arbitrum/nitro-contracts-2.1.1/src/express-lane-auction/IExpressLaneAuction.sol";

/**
* @title DeployAddWasmCacheManagerActionScript
* @notice This script deploys CacheManager and then deploys action that's used to add cache manager on a child chain.
*/
contract DeployExpressLaneAuctionScript is DeploymentHelpersScript {
// https://github.com/OffchainLabs/nitro/releases/tag/consensus-v32
uint256 public constant TARGET_ARBOS_VERSION = 32;

function run() public {
vm.startBroadcast();

// deploy CacheManger behind proxy
address expressLaneAuctionLogic = deployBytecodeFromJSON(
"/node_modules/@arbitrum/nitro-contracts-2.1.1/build/contracts/src/express-lane-auction/ExpressLaneAuction.sol/ExpressLaneAuction.json"
);
address expressLaneAuctionProxy = address(
new TransparentUpgradeableProxy(
expressLaneAuctionLogic,
vm.envAddress("PROXY_ADMIN_ADDRESS"),
abi.encodeCall(
IExpressLaneAuction.initialize,
InitArgs({
_auctioneer: vm.envAddress("AUCTIONEER_ADDRESS"),
_biddingToken: vm.envAddress("BIDDING_TOKEN_ADDRESS"),
_beneficiary: vm.envAddress("BENEFICIARY_ADDRESS"),
_roundTimingInfo: RoundTimingInfo({
offsetTimestamp: block.timestamp,
roundDurationSeconds: vm.envUint("ROUND_DURATION_SECONDS"),
auctionClosingSeconds: vm.envUint("AUCTION_CLOSING_SECONDS"),
reserveSubmissionSeconds: vm.envUint("RESERVE_SUBMISSION_SECONDS")
}),
_minReservePrice: 0,
_auctioneerAdmin: vm.envAddress("AUCTIONEER_ADMIN_ADDRESS"),
_minReservePriceSetter: vm.envAddress("MIN_RESERVE_PRICE_SETTER_ADDRESS"),
_reservePriceSetter: vm.envAddress("RESERVE_PRICE_SETTER_ADDRESS"),
_reservePriceSetterAdmin: vm.envAddress("RESERVE_PRICE_SETTER_ADMIN_ADDRESS"),
_beneficiarySetter: vm.envAddress("BENEFICIARY_SETTER_ADDRESS"),
_roundTimingSetter: vm.envAddress("ROUND_TIMING_SETTER_ADDRESS"),
_masterAdmin: vm.envAddress("MASTER_ADMIN_ADDRESS")
})
)
)
);

vm.stopBroadcast();
}
}
20 changes: 20 additions & 0 deletions scripts/foundry/timeboost/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Deploy ExpressLaneAuction contract

This script deploy ExpressLaneAuction contract, the contract can then be configured in the sequencer to enable timeboost.

## How to use it

1. Setup .env according to the example files, make sure you provide correct values.

> [!CAUTION]
> The .env file must be in project root.

`DeployExpressLaneAuction.s.sol` script deploys `ExpressLaneAuction` behind a proxy. It can be executed in this directory like this:

```bash
forge script --sender $DEPLOYER --rpc-url $CHILD_CHAIN_RPC --broadcast --slow ./DeployExpressLaneAuction.s.sol -vvv --verify --broadcast
# use --account XXX / --private-key XXX / --interactive / --ledger to set the account to send the transaction from
```

The deployer does not need to be the chain owner or have any admin privilege.

11 changes: 11 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,17 @@
patch-package "^6.4.7"
solady "0.0.182"

"@arbitrum/nitro-contracts-2.1.1@npm:@arbitrum/[email protected]":
version "2.1.1-beta.0"
resolved "https://registry.yarnpkg.com/@arbitrum/nitro-contracts/-/nitro-contracts-2.1.1-beta.0.tgz#ee75671ea1d4b62a9ba9818311865b573dd0b382"
integrity sha512-CWhU0s0VPv1IWF+nBxMy6iS9L6hRfXpuebknykAzjFOGVfK2Un7OVBXp1c7p172nTwYYerjuAqo/KFIQUOU2Kg==
dependencies:
"@offchainlabs/upgrade-executor" "1.1.0-beta.0"
"@openzeppelin/contracts" "4.5.0"
"@openzeppelin/contracts-upgradeable" "4.5.2"
patch-package "^6.4.7"
solady "0.0.182"

"@arbitrum/[email protected]":
version "1.1.1"
resolved "https://registry.yarnpkg.com/@arbitrum/nitro-contracts/-/nitro-contracts-1.1.1.tgz#2d8a2f9ab757bb7654562aebe435bff833c4b98d"
Expand Down
Loading