-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from ajna-finance/deployment
GrantFund deployment
- Loading branch information
Showing
6 changed files
with
112 additions
and
21 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
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 |
---|---|---|
@@ -1,16 +1,21 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.7; | ||
|
||
import { Script } from "forge-std/Script.sol"; | ||
import { Script } from "forge-std/Script.sol"; | ||
import "forge-std/console.sol"; | ||
|
||
import { AjnaToken } from "../src/token/AjnaToken.sol"; | ||
import { IERC20 } from "@oz/token/ERC20/IERC20.sol"; | ||
|
||
contract DeployAjnaToken is Script { | ||
|
||
function run() public { | ||
vm.startBroadcast(); | ||
|
||
new AjnaToken(vm.envAddress("MINT_TO_ADDRESS")); | ||
address mintTo = vm.envAddress("MINT_TO_ADDRESS"); | ||
|
||
vm.startBroadcast(); | ||
address ajna = address(new AjnaToken(mintTo)); | ||
vm.stopBroadcast(); | ||
|
||
console.log("AJNA token deployed to %s", ajna); | ||
console.log("Minting %s AJNA token to %s", (IERC20(ajna)).totalSupply() / 1e18, mintTo); | ||
} | ||
} |
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,28 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.16; | ||
|
||
import { Script } from "forge-std/Script.sol"; | ||
import "forge-std/console.sol"; | ||
|
||
import { IVotes } from "@oz/governance/utils/IVotes.sol"; | ||
import { IERC20 } from "@oz/token/ERC20/IERC20.sol"; | ||
|
||
import { GrantFund } from "src/grants/GrantFund.sol"; | ||
import { Maths } from "src/grants/libraries/Maths.sol"; | ||
|
||
contract DeployGrantFund is Script { | ||
uint256 constant TREASURY_PCT_OF_AJNA_SUPPLY = 0.3 * 1e18; | ||
|
||
function run() public { | ||
IERC20 ajna = IERC20(vm.envAddress("AJNA_TOKEN")); | ||
console.log("Deploying GrantFund to chain with AJNA token address %s", address(ajna)); | ||
|
||
vm.startBroadcast(); | ||
uint256 treasury = Maths.wmul(ajna.totalSupply(), TREASURY_PCT_OF_AJNA_SUPPLY); | ||
address grantFund = address(new GrantFund(IVotes(address(ajna)), treasury)); | ||
vm.stopBroadcast(); | ||
|
||
console.log("GrantFund deployed to %s", grantFund); | ||
console.log("Please transfer %s AJNA (%s WAD) into the treasury", treasury / 1e18, treasury); | ||
} | ||
} |
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