diff --git a/script/DeployNodlMigration.sol b/script/DeployNodlMigration.sol index 50894f06..e8ba57b8 100644 --- a/script/DeployNodlMigration.sol +++ b/script/DeployNodlMigration.sol @@ -7,7 +7,7 @@ import {Script, console} from "forge-std/Script.sol"; import {NODL} from "../src/NODL.sol"; import {NODLMigration} from "../src/bridge/NODLMigration.sol"; -contract DeployClick is Script { +contract DeployNodlMigration is Script { address[] internal voters; address internal withdrawer; diff --git a/script/DeployRewards.sol b/script/DeployRewards.sol new file mode 100644 index 00000000..0697a99e --- /dev/null +++ b/script/DeployRewards.sol @@ -0,0 +1,42 @@ +// SPDX-License-Identifier: BSD-3-Clause-Clear + +pragma solidity 0.8.23; + +import {Script, console} from "forge-std/Script.sol"; + +import {NODL} from "../src/NODL.sol"; +import {Rewards} from "../src/Rewards.sol"; + +contract DeployRewards is Script { + address internal nodlAddress; + address internal oracleAddress; + uint256 internal rewardQuotaPerPeriod; + uint256 internal rewardPeriod; + uint256 internal batchSubmitterIncentive; // in percentage of total rewards in a batch. 1 = 1% + + function setUp() public { + nodlAddress = vm.envOr("N_TOKEN_ADDR", address(0)); + oracleAddress = vm.envAddress("N_REWARDS_ORACLE_ADDR"); + rewardQuotaPerPeriod = vm.envUint("N_REWARDS_QUOTA"); + rewardPeriod = vm.envUint("N_REWARDS_PERIOD"); + batchSubmitterIncentive = vm.envUint("N_REWARDS_SUBMITTER_INCENTIVE"); + } + + function run() public { + vm.startBroadcast(); + if (nodlAddress == address(0)) { + NODL token = new NODL(); + nodlAddress = address(token); + console.log("Deployed NODL at %s", nodlAddress); + } + + NODL nodl = NODL(nodlAddress); + Rewards rewards = new Rewards(nodl, rewardQuotaPerPeriod, rewardPeriod, oracleAddress, batchSubmitterIncentive); + address rewardsAddress = address(rewards); + nodl.grantRole(nodl.MINTER_ROLE(), rewardsAddress); + + vm.stopBroadcast(); + + console.log("Deployed Rewards at %s", rewardsAddress); + } +}