-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: DeployExpressLaneAuctionScript
- Loading branch information
Showing
3 changed files
with
91 additions
and
0 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,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 |
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,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(); | ||
} | ||
} |
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,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. | ||
|