Deploy Script
UPDATE 8/21/2024 @1251 AM
New Script - DeployDAO.s.sol
A new script file, DeployDAO.s.sol
, has been introduced. This script handles the deployment of the DAO separately from other contract deployments.
Purpose of DeployDAO.s.sol
- Deployment of DAO: This script is responsible for deploying the
RBGovernor
and related contracts that manage DAO governance. - Modular Deployment: Having a separate script for DAO deployment allows for modular deployment of the smart contract system, making the process more efficient and manageable.
Usage
- This script should be executed as part of the deployment process to ensure that the DAO is correctly deployed and configured according to your requirements.
DeployContracts.s.sol
Overview
The DeployContracts
script is used to deploy and initialize various smart contracts required for the RunBro ecosystem. This includes deploying the RunBroToken
, Escrow
, WethRegistry
, MarketPlace
, GetStepsAPI
, WethReward
, and DAO-related contracts (Lock
and RBGovernor
).
Inheritance
The script inherits from:
Script
: Provides functionality for running deployment scripts in Foundry.
Constants
wethAddress
: The address of the WETH token contract on Sepolia (or Amoy, commented out).initialSupply
: The initial supply of RunBroTokens.initial_rbTokens_inPool
: The initial amount of RunBroTokens in the pool.initial_weth_inPool
: The initial amount of WETH in the pool.MIN_DELAY
: The minimum delay for the DAO timelock (1 hour).QUORUM_PERCENTAGE
: The quorum percentage required for DAO proposals (4%).VOTING_PERIOD
: The voting period for DAO proposals.VOTING_DELAY
: The delay before a proposal vote becomes active.
Variables
seller
: The address of the seller.buyer
: The address of the buyer.owner
: The address of the contract owner.proposers
: An array of proposer addresses for the DAO.executors
: An array of executor addresses for the DAO.lock
: TheLock
contract instance for the DAO.rbgovernor
: TheRBGovernor
contract instance for the DAO.
Functions
run
function run() external
- Description: Deploys and initializes the various contracts required for the RunBro ecosystem. It also sets up the DAO with the
Lock
andRBGovernor
contracts.
Deployment Steps
- Deploy RunBroToken:
- Deploys the
RunBroToken
contract with the initial supply.
- Deploys the
- Deploy Escrow:
- Deploys the
Escrow
contract.
- Deploys the
- Deploy WethRegistry:
- Deploys the
WethRegistry
contract.
- Deploys the
- Deploy MarketPlace:
- Deploys the
MarketPlace
contract with the addresses ofWethRegistry
,WETH
,Escrow
, andRunBroToken
.
- Deploys the
- Deploy GetStepsAPI:
- Deploys the
GetStepsAPI
contract with the address ofWethRegistry
.
- Deploys the
- Deploy WethReward:
- Deploys the
WethReward
contract with the addresses ofWETH
,MarketPlace
,WethRegistry
, andGetStepsAPI
.
- Deploys the
- Deploy DAO Contracts:
- Deploys the
Lock
contract with the minimum delay, proposers, and executors. - Deploys the
RBGovernor
contract with theRunBroToken
andLock
contracts.
- Deploys the
- Setup DAO Roles:
- Grants the proposer role to the
RBGovernor
contract. - Grants the executor role to the zero address (open execution).
- Revokes the admin role from the deployer.
- Grants the proposer role to the
Console Logs
- Logs the addresses of the deployed contracts for reference.