diff --git a/src/contract.cairo b/src/contract.cairo index 9cdea106..32f47ef8 100644 --- a/src/contract.cairo +++ b/src/contract.cairo @@ -46,6 +46,9 @@ mod Governance { #[abi(embed_v0)] impl Proposals = proposals_component::ProposalsImpl; + #[abi(embed_v0)] + impl Upgrades = upgrades_component::UpgradesImpl; + #[storage] struct Storage { proposal_initializer_run: LegacyMap::, diff --git a/src/token.cairo b/src/token.cairo index 9c4b257b..3451776a 100644 --- a/src/token.cairo +++ b/src/token.cairo @@ -1,4 +1,5 @@ // This is a freely tradable ERC20 token. +// TODO upgradability #[starknet::contract] mod FloatingToken { @@ -12,6 +13,8 @@ mod FloatingToken { impl ERC20Impl = ERC20Component::ERC20Impl; #[abi(embed_v0)] impl ERC20MetadataImpl = ERC20Component::ERC20MetadataImpl; + #[abi(embed_v0)] + impl ERC20CamelOnlyImpl = ERC20Component::ERC20CamelOnlyImpl; impl InternalImpl = ERC20Component::InternalImpl; diff --git a/src/voting_token.cairo b/src/voting_token.cairo index 681aa921..0d8edeae 100644 --- a/src/voting_token.cairo +++ b/src/voting_token.cairo @@ -1,8 +1,9 @@ // This is the locked Cairo token. +// TODO upgradability #[starknet::contract] mod VotingToken { - use openzeppelin::token::erc20::interface::IERC20; + use openzeppelin::token::erc20::interface::{IERC20, IERC20CamelOnly}; use openzeppelin::token::erc20::ERC20Component; use starknet::ContractAddress; @@ -36,6 +37,27 @@ mod VotingToken { self.erc20._mint(recipient, fixed_supply); } + #[abi(embed_v0)] + impl VotingTokenCamelOnly of IERC20CamelOnly { + fn totalSupply(self: @ContractState) -> u256 { + self.erc20.total_supply() + } + + fn balanceOf(self: @ContractState, account: ContractAddress) -> u256 { + self.erc20.balance_of(account) + } + + fn transferFrom( + ref self: ContractState, + sender: ContractAddress, + recipient: ContractAddress, + amount: u256 + ) -> bool { + assert(false, 'token locked, unwrap first'); + false + } + } + #[abi(embed_v0)] impl VotingToken of IERC20 { fn total_supply(self: @ContractState) -> u256 {