Skip to content

Commit

Permalink
Fix name and redeploy (#18)
Browse files Browse the repository at this point in the history
* Fix name and redeploy

* verify

* fmt
  • Loading branch information
hujw77 authored Aug 12, 2024
1 parent 16e756a commit d05e05d
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 15 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
| KTONStakingRewards | 0x000000000419683a1a03AbC21FC9da25fd2B4dD7 |
| RewardsDistribution | 0x000000000Ae5DB7BDAf8D071e680452e33d91Dd5 |
| modlda/trsry | 0x6d6f646c64612f74727372790000000000000000 |
| gKTON | 0xa42980efF5439F97A768F0B7a00c70ff0a213977 |
| KtonDAO | 0xF3522CA27807ED1264e399FaC42e8621Db4b5Dc4 |
| Timelock | 0xb80b7Bd1001d6B5D4a9bf0d3524b85b244147C30 |
| KtonDAOVault | 0x9e5cED4C978F92591fD0609c5c781e6aDdB75ac0 |
| gKTON | 0xB633Ad1142941CA2Eb9C350579cF88BbE266660D |
| KtonDAO | 0xaAC63c40930cCAF99603229F6381D82966b145ef |
| Timelock | 0x08837De0Ae21C270383D9F2de4DB03c7b1314632 |
| KtonDAOVault | 0x652182C6aBc0bBE41b5702b05a26d109A405EAcA |
2 changes: 1 addition & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
src = "src"
out = "out"
libs = ["lib"]
sender = "0xcaEaf98F2131022A62841f798f47B904cDCb7114"
sender = "0xB1543d879C0274937D8e217285F6273e0679D1e3"
force = true
ffi = true
ast = true
Expand Down
26 changes: 20 additions & 6 deletions script/Deploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,15 @@ import {KtonTimelockController} from "../src/governance/KtonTimelockController.s
import {KtonDAOVault} from "../src/staking/KtonDAOVault.sol";

contract DeployScript is Script {
address gKTON = 0xa42980efF5439F97A768F0B7a00c70ff0a213977;
address ktonDAO = 0xF3522CA27807ED1264e399FaC42e8621Db4b5Dc4;
address timelock = 0xb80b7Bd1001d6B5D4a9bf0d3524b85b244147C30;
address vault = 0x9e5cED4C978F92591fD0609c5c781e6aDdB75ac0;
address gKTON = 0xB633Ad1142941CA2Eb9C350579cF88BbE266660D;
address ktonDAO = 0xaAC63c40930cCAF99603229F6381D82966b145ef;
address timelock = 0x08837De0Ae21C270383D9F2de4DB03c7b1314632;
address vault = 0x652182C6aBc0bBE41b5702b05a26d109A405EAcA;

struct Settings {
string gKtonName;
string gKtonSymbol;
string daoName;
uint256 quorum;
uint256 initialProposalThreshold;
uint32 initialVotingPeriod;
Expand All @@ -27,20 +30,29 @@ contract DeployScript is Script {
function getSettings(uint256 chainId) public pure returns (Settings memory) {
if (chainId == 701) {
return Settings({
gKtonName: "Governance PKTON",
gKtonSymbol: "gPKTON",
daoName: "PKtonDAO",
quorum: 3e16,
initialProposalThreshold: 1e16,
initialVotingPeriod: 1 hours,
timelockDeplay: 0
});
} else if (chainId == 44) {
return Settings({
gKtonName: "Governance CKTON",
gKtonSymbol: "gCKTON",
daoName: "CKtonDAO",
quorum: 4_500e18,
initialProposalThreshold: 35e18,
initialVotingPeriod: 30 days,
timelockDeplay: 3 days
});
} else if (chainId == 46) {
return Settings({
gKtonName: "Governance KTON",
gKtonSymbol: "gKTON",
daoName: "KtonDAO",
quorum: 3_000e18,
initialProposalThreshold: 20e18,
initialVotingPeriod: 30 days,
Expand All @@ -56,7 +68,9 @@ contract DeployScript is Script {
Settings memory s = getSettings(block.chainid);

address gKTON_PROXY = Upgrades.deployTransparentProxy(
"GovernanceKTON.sol:GovernanceKTON", timelock, abi.encodeCall(GovernanceKTON.initialize, (vault))
"GovernanceKTON.sol:GovernanceKTON",
timelock,
abi.encodeCall(GovernanceKTON.initialize, (vault, s.gKtonName, s.gKtonSymbol))
);
safeconsole.log("gKTON: ", gKTON_PROXY);
safeconsole.log("gKTON_Logic: ", Upgrades.getImplementationAddress(gKTON_PROXY));
Expand All @@ -75,7 +89,7 @@ contract DeployScript is Script {
0,
s.initialVotingPeriod,
s.initialProposalThreshold,
"KtonDAO"
s.daoName
)
),
opts
Expand Down
6 changes: 3 additions & 3 deletions src/governance/GovernanceKTON.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ contract GovernanceKTON is
_disableInitializers();
}

function initialize(address _rewardsDistribution) public initializer {
function initialize(address _rewardsDistribution, string memory name, string memory symbol) public initializer {
__StakingRewards_init(_rewardsDistribution);
__ERC20_init("Governance KTON", "gKTON");
__ERC20Permit_init("Governance KTON");
__ERC20_init(name, symbol);
__ERC20Permit_init(name);
__ERC20Votes_init();
__ERC165_init();
}
Expand Down
2 changes: 1 addition & 1 deletion verify/GovernanceKTON.json

Large diffs are not rendered by default.

0 comments on commit d05e05d

Please sign in to comment.