-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(contract): Add deployment info; update base script; use .env
- Loading branch information
Showing
9 changed files
with
266 additions
and
19 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
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,29 @@ | ||
### Salt used to deploy the contract. Recommended to use the same salt across different chains. | ||
CREATE2_SALT=0x0000000000000000000000000000000000000000000000000000000000000000 | ||
|
||
### The owner of the DrandOracle contract. | ||
OWNER= | ||
|
||
### The signer of the DrandOracle contract. | ||
SIGNER= | ||
|
||
### The chain hash of the DrandOracle contract. | ||
CHAIN_HASH= | ||
|
||
### The chain to deploy to, specified by chain name (e.g. CHAIN=gravity_sepolia) | ||
CHAIN= | ||
|
||
### RPCs for each chain ID | ||
RPC_GRAVITY=https://rpc.gravity.xyz | ||
RPC_GRAVITY_SEPOLIA=https://rpc-sepolia.gravity.xyz | ||
|
||
# Etherscan API keys for each chain | ||
ETHERSCAN_API_KEY_GRAVITY=123 | ||
ETHERSCAN_API_KEY_GRAVITY_SEPOLIA=123 | ||
|
||
# Etherscan API URLs for each chain | ||
ETHERSCAN_API_URL_GRAVITY=https://explorer.gravity.xyz/api | ||
ETHERSCAN_API_URL_GRAVITY_SEPOLIA=https://explorer-sepolia.gravity.xyz/api | ||
|
||
## Contract Deployer Private Key | ||
PRIVATE_KEY= |
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
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
81 changes: 81 additions & 0 deletions
81
contracts/broadcast/DrandOracle.s.sol/13505/run-1730411681.json
Large diffs are not rendered by default.
Oops, something went wrong.
81 changes: 81 additions & 0 deletions
81
contracts/broadcast/DrandOracle.s.sol/13505/run-latest.json
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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,35 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.20; | ||
|
||
import "forge-std/Vm.sol"; | ||
import "forge-std/console.sol"; | ||
import {stdJson} from "forge-std/StdJson.sol"; | ||
import {Script} from "forge-std/Script.sol"; | ||
|
||
/// @notice Script to inherit from to get access to helper functions for deployments. | ||
abstract contract BaseScript is Script { | ||
using stdJson for string; | ||
|
||
/// @notice Run the command with the `--broadcast` flag to send the transaction to the chain, | ||
/// otherwise just simulate the transaction execution. | ||
modifier broadcaster() { | ||
uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY"); | ||
console.log("Deployer: %s", vm.addr(deployerPrivateKey)); | ||
vm.startBroadcast(deployerPrivateKey); | ||
_; | ||
vm.stopBroadcast(); | ||
} | ||
|
||
/// @notice Runs the script on the chain specified in the `CHAIN` env variable. | ||
/// Must have a `RPC_${CHAIN}` env variable set for the chain (e.g. RPC_MAINNET). | ||
modifier chain() { | ||
string memory c = vm.envString("CHAIN"); | ||
|
||
// Switch to the chain using the RPC | ||
vm.createSelectFork(c); | ||
|
||
console.log("Running script on %s", c); | ||
|
||
_; | ||
} | ||
} |