Skip to content

Commit

Permalink
feat: DeployExpressLaneAuctionScript
Browse files Browse the repository at this point in the history
  • Loading branch information
gzeoneth committed Oct 30, 2024
1 parent 227b5a8 commit 4116a87
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 0 deletions.
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.

0 comments on commit 4116a87

Please sign in to comment.