diff --git a/contracts/CErc20.sol b/contracts/CErc20.sol index ddf625bcd..8355a0238 100644 --- a/contracts/CErc20.sol +++ b/contracts/CErc20.sol @@ -210,6 +210,7 @@ contract CErc20 is CToken, CErc20Interface { require(success, "TOKEN_TRANSFER_OUT_FAILED"); } + // TODO: delete /** * @notice Admin call to delegate the votes of the COMP-like underlying * @param compLikeDelegatee The address to delegate votes to diff --git a/contracts/CErc20Immutable.sol b/contracts/CErc20Immutable.sol index 164f1bcc7..ecf2c3f22 100644 --- a/contracts/CErc20Immutable.sol +++ b/contracts/CErc20Immutable.sol @@ -2,6 +2,8 @@ pragma solidity ^0.5.16; import "./CErc20.sol"; +// TODO: need to figure if this is useful for Canto Lending market (probably useful) + /** * @title Compound's CErc20Immutable Contract * @notice CTokens which wrap an EIP-20 underlying and are immutable diff --git a/contracts/Comptroller.sol b/contracts/Comptroller.sol index 4399c3f61..19f5084b7 100644 --- a/contracts/Comptroller.sol +++ b/contracts/Comptroller.sol @@ -1368,6 +1368,8 @@ contract Comptroller is ComptrollerV7Storage, ComptrollerInterface, ComptrollerE * @param amount The amount of COMP to (possibly) transfer * @return The amount of COMP which was NOT transferred to the user */ + + //TODO: Modify this function to grant CANTO Tokens function grantCompInternal(address user, uint amount) internal returns (uint) { Comp comp = Comp(getCompAddress()); uint compRemaining = comp.balanceOf(address(this)); @@ -1461,6 +1463,7 @@ contract Comptroller is ComptrollerV7Storage, ComptrollerInterface, ComptrollerE * @notice Return the address of the COMP token * @return The address of COMP */ + //TODO: Edit this to the address of the contract with CANTO Tokens function getCompAddress() public view returns (address) { return 0xc00e94Cb662C3520282E6f5717214004A7f26888; } diff --git a/contracts/ComptrollerG7.sol b/contracts/ComptrollerG7.sol index fb1b280b2..4ba5d1647 100644 --- a/contracts/ComptrollerG7.sol +++ b/contracts/ComptrollerG7.sol @@ -8,6 +8,8 @@ import "./ComptrollerStorage.sol"; import "./Unitroller.sol"; import "./Governance/Comp.sol"; +// TODO: need to confirm that g7 is latest comptroller; why are there still commits being made on original Comptroller - https://github.com/compound-finance/compound-protocol/commits/master/contracts/Comptroller.sol + /** * @title Compound's Comptroller Contract * @author Compound @@ -551,7 +553,7 @@ contract ComptrollerG7 is ComptrollerV5Storage, ComptrollerInterface, Comptrolle // Keep the flywheel moving updateCompSupplyIndex(cTokenCollateral); - distributeSupplierComp(cTokenCollateral, borrower); + distributeSupplierComp(cTokenCollateral, borrower); // TODO: why is suppliercomp distributed to borrower distributeSupplierComp(cTokenCollateral, liquidator); return uint(Error.NO_ERROR); @@ -1090,7 +1092,8 @@ contract ComptrollerG7 is ComptrollerV5Storage, ComptrollerInterface, Comptrolle emit CompSpeedUpdated(cToken, compSpeed); } } - + + // TODO: need to understand where the drip tokens are being created; what functions are distributing them? /** * @notice Accrue COMP to the market by updating the supply index * @param cToken The market whose supply index to update @@ -1247,6 +1250,7 @@ contract ComptrollerG7 is ComptrollerV5Storage, ComptrollerInterface, Comptrolle } } + // TODO: need to change this transfer Canto instead of Comp /** * @notice Transfer COMP to the user * @dev Note: If there is not enough COMP, we do not perform the transfer all. @@ -1323,6 +1327,7 @@ contract ComptrollerG7 is ComptrollerV5Storage, ComptrollerInterface, Comptrolle return block.number; } + // TODO: modify this to the Canto Address /** * @notice Return the address of the COMP token * @return The address of COMP diff --git a/contracts/Governance/Comp.sol b/contracts/Governance/Comp.sol index 6494bedce..bc12b5553 100644 --- a/contracts/Governance/Comp.sol +++ b/contracts/Governance/Comp.sol @@ -1,6 +1,8 @@ pragma solidity ^0.5.16; pragma experimental ABIEncoderV2; +// TODO: delete this file; may need to create an EIP-20 interface for Canto token + contract Comp { /// @notice EIP-20 token name for this token string public constant name = "Compound"; diff --git a/contracts/Governance/GovernorBravoDelegateG2.sol b/contracts/Governance/GovernorBravoDelegateG2.sol index cc8ea398a..da907f229 100644 --- a/contracts/Governance/GovernorBravoDelegateG2.sol +++ b/contracts/Governance/GovernorBravoDelegateG2.sol @@ -5,6 +5,9 @@ import "./GovernorBravoInterfaces.sol"; contract GovernorBravoDelegate is GovernorBravoDelegateStorageV2, GovernorBravoEvents { + /* + TODO: remove all constants related to creating and approving proposals + /// @notice The name of this contract string public constant name = "Compound Governor Bravo"; @@ -28,13 +31,16 @@ contract GovernorBravoDelegate is GovernorBravoDelegateStorageV2, GovernorBravoE /// @notice The number of votes in support of a proposal required in order for a quorum to be reached and for a vote to succeed uint public constant quorumVotes = 400000e18; // 400,000 = 4% of Comp + */ /// @notice The maximum number of actions that can be included in a proposal uint public constant proposalMaxOperations = 10; // 10 actions - + + // TODO: figure out if we need DOMAIN_TYPEHASH /// @notice The EIP-712 typehash for the contract's domain bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)"); + // TODO: delete BALLOT_TYPEHASH /// @notice The EIP-712 typehash for the ballot struct used by the contract bytes32 public constant BALLOT_TYPEHASH = keccak256("Ballot(uint256 proposalId,uint8 support)"); @@ -50,16 +56,26 @@ contract GovernorBravoDelegate is GovernorBravoDelegateStorageV2, GovernorBravoE require(address(timelock) == address(0), "GovernorBravo::initialize: can only initialize once"); require(msg.sender == admin, "GovernorBravo::initialize: admin only"); require(timelock_ != address(0), "GovernorBravo::initialize: invalid timelock address"); + + // TODO: replace comp initialization with canto initialization require(comp_ != address(0), "GovernorBravo::initialize: invalid comp address"); + + /* + TODO: remove all checks for voting and proposal thresholds require(votingPeriod_ >= MIN_VOTING_PERIOD && votingPeriod_ <= MAX_VOTING_PERIOD, "GovernorBravo::initialize: invalid voting period"); require(votingDelay_ >= MIN_VOTING_DELAY && votingDelay_ <= MAX_VOTING_DELAY, "GovernorBravo::initialize: invalid voting delay"); require(proposalThreshold_ >= MIN_PROPOSAL_THRESHOLD && proposalThreshold_ <= MAX_PROPOSAL_THRESHOLD, "GovernorBravo::initialize: invalid proposal threshold"); + */ timelock = TimelockInterface(timelock_); + // TODO: replace comp and CompInterface with Canto declaration comp = CompInterface(comp_); + /* + TODO: delete these; no need for voting logic votingPeriod = votingPeriod_; votingDelay = votingDelay_; proposalThreshold = proposalThreshold_; + */ } /** @@ -71,6 +87,8 @@ contract GovernorBravoDelegate is GovernorBravoDelegateStorageV2, GovernorBravoE * @param description String description of the proposal * @return Proposal id of new proposal */ + /** + TODO: delete this propose function; proposals will be sent from off-chain and directly to the queue function below function propose(address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas, string memory description) public returns (uint) { // Reject proposals before initiating as Governor require(initialProposalId != 0, "GovernorBravo::propose: Governor Bravo not active"); @@ -114,6 +132,7 @@ contract GovernorBravoDelegate is GovernorBravoDelegateStorageV2, GovernorBravoE emit ProposalCreated(newProposal.id, msg.sender, targets, values, signatures, calldatas, startBlock, endBlock, description); return newProposal.id; } + */ /** * @notice Queues a proposal of state succeeded @@ -122,6 +141,7 @@ contract GovernorBravoDelegate is GovernorBravoDelegateStorageV2, GovernorBravoE function queue(uint proposalId) external { require(state(proposalId) == ProposalState.Succeeded, "GovernorBravo::queue: proposal can only be queued if it is succeeded"); Proposal storage proposal = proposals[proposalId]; + // TODO: need to look into definition of timelock delay - make sure it meets our requirements uint eta = add256(block.timestamp, timelock.delay()); for (uint i = 0; i < proposal.targets.length; i++) { queueOrRevertInternal(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], eta); @@ -154,6 +174,8 @@ contract GovernorBravoDelegate is GovernorBravoDelegateStorageV2, GovernorBravoE * @param proposalId The id of the proposal to cancel */ function cancel(uint proposalId) external { + // TODO: only admin can cancel contracts; change logic here accordingly + require(state(proposalId) != ProposalState.Executed, "GovernorBravo::cancel: cannot cancel executed proposal"); Proposal storage proposal = proposals[proposalId]; @@ -187,6 +209,7 @@ contract GovernorBravoDelegate is GovernorBravoDelegateStorageV2, GovernorBravoE return (p.targets, p.values, p.signatures, p.calldatas); } + // TODO: delete getReceipt /** * @notice Gets the receipt for a voter on a given proposal * @param proposalId the id of proposal @@ -203,6 +226,8 @@ contract GovernorBravoDelegate is GovernorBravoDelegateStorageV2, GovernorBravoE * @return Proposal state */ function state(uint proposalId) public view returns (ProposalState) { + // TODO: remove all logic related to proposal voting from here + // TODO: delete PENDING, DEFEATED, Canceled, Active, Succeeded state logic require(proposalCount >= proposalId && proposalId > initialProposalId, "GovernorBravo::state: invalid proposal id"); Proposal storage proposal = proposals[proposalId]; if (proposal.canceled) { @@ -217,6 +242,7 @@ contract GovernorBravoDelegate is GovernorBravoDelegateStorageV2, GovernorBravoE return ProposalState.Succeeded; } else if (proposal.executed) { return ProposalState.Executed; + // TODO: when is the Expired state needed? why add a grace period? } else if (block.timestamp >= add256(proposal.eta, timelock.GRACE_PERIOD())) { return ProposalState.Expired; } else { @@ -224,6 +250,7 @@ contract GovernorBravoDelegate is GovernorBravoDelegateStorageV2, GovernorBravoE } } + // TODO: delete castVote /** * @notice Cast a vote for a proposal * @param proposalId The id of the proposal to vote on @@ -233,6 +260,7 @@ contract GovernorBravoDelegate is GovernorBravoDelegateStorageV2, GovernorBravoE emit VoteCast(msg.sender, proposalId, support, castVoteInternal(msg.sender, proposalId, support), ""); } + // TODO: delete castVoteWithReason /** * @notice Cast a vote for a proposal with a reason * @param proposalId The id of the proposal to vote on @@ -243,6 +271,7 @@ contract GovernorBravoDelegate is GovernorBravoDelegateStorageV2, GovernorBravoE emit VoteCast(msg.sender, proposalId, support, castVoteInternal(msg.sender, proposalId, support), reason); } + // TODO: delete castVoteBySig /** * @notice Cast a vote for a proposal by signature * @dev External function that accepts EIP-712 signatures for voting on proposals. @@ -256,6 +285,7 @@ contract GovernorBravoDelegate is GovernorBravoDelegateStorageV2, GovernorBravoE emit VoteCast(signatory, proposalId, support, castVoteInternal(signatory, proposalId, support), ""); } + // TODO: delete castVoteInternal /** * @notice Internal function that caries out voting logic * @param voter The voter that is casting their vote @@ -285,7 +315,8 @@ contract GovernorBravoDelegate is GovernorBravoDelegateStorageV2, GovernorBravoE return votes; } - + + // TODO: delete isWhitelisted /** * @notice View function which returns if an account is whitelisted * @param account Account to check white list status of @@ -295,6 +326,7 @@ contract GovernorBravoDelegate is GovernorBravoDelegateStorageV2, GovernorBravoE return (whitelistAccountExpirations[account] > now); } + // TODO: delete _setVotingDelay /** * @notice Admin function for setting the voting delay * @param newVotingDelay new voting delay, in blocks @@ -308,6 +340,7 @@ contract GovernorBravoDelegate is GovernorBravoDelegateStorageV2, GovernorBravoE emit VotingDelaySet(oldVotingDelay,votingDelay); } + // TODO: delete _setVotingPeriod /** * @notice Admin function for setting the voting period * @param newVotingPeriod new voting period, in blocks @@ -321,6 +354,7 @@ contract GovernorBravoDelegate is GovernorBravoDelegateStorageV2, GovernorBravoE emit VotingPeriodSet(oldVotingPeriod, votingPeriod); } + // TODO: delete _setProposalThreshold /** * @notice Admin function for setting the proposal threshold * @dev newProposalThreshold must be greater than the hardcoded min @@ -335,6 +369,7 @@ contract GovernorBravoDelegate is GovernorBravoDelegateStorageV2, GovernorBravoE emit ProposalThresholdSet(oldProposalThreshold, proposalThreshold); } + // TODO: delete _setWhitelistAccountExpiration /** * @notice Admin function for setting the whitelist expiration as a timestamp for an account. Whitelist status allows accounts to propose without meeting threshold * @param account Account address to set whitelist expiration for @@ -347,6 +382,7 @@ contract GovernorBravoDelegate is GovernorBravoDelegateStorageV2, GovernorBravoE emit WhitelistAccountExpirationSet(account, expiration); } + // TODO: delete _setWhitelistGuardian /** * @notice Admin function for setting the whitelistGuardian. WhitelistGuardian can cancel proposals from whitelisted addresses * @param account Account to set whitelistGuardian to (0x0 to remove whitelistGuardian) @@ -359,6 +395,7 @@ contract GovernorBravoDelegate is GovernorBravoDelegateStorageV2, GovernorBravoE emit WhitelistGuardianSet(oldGuardian, whitelistGuardian); } + // TODO: delete _initiate /** * @notice Initiate the GovernorBravo contract * @dev Admin only. Sets initial proposal id which initiates the contract, ensuring a continuous proposal id count diff --git a/contracts/Governance/GovernorBravoInterfaces.sol b/contracts/Governance/GovernorBravoInterfaces.sol index 100fd72dd..a5667deb4 100644 --- a/contracts/Governance/GovernorBravoInterfaces.sol +++ b/contracts/Governance/GovernorBravoInterfaces.sol @@ -3,9 +3,11 @@ pragma experimental ABIEncoderV2; contract GovernorBravoEvents { + // TODO: delete /// @notice An event emitted when a new proposal is created event ProposalCreated(uint id, address proposer, address[] targets, uint[] values, string[] signatures, bytes[] calldatas, uint startBlock, uint endBlock, string description); + // TODO: delete /// @notice An event emitted when a vote has been cast on a proposal /// @param voter The address which casted a vote /// @param proposalId The proposal id which was voted on @@ -20,18 +22,22 @@ contract GovernorBravoEvents { /// @notice An event emitted when a proposal has been queued in the Timelock event ProposalQueued(uint id, uint eta); + // TODO: delete /// @notice An event emitted when a proposal has been executed in the Timelock event ProposalExecuted(uint id); + // TODO: delete /// @notice An event emitted when the voting delay is set event VotingDelaySet(uint oldVotingDelay, uint newVotingDelay); + // TODO: delete /// @notice An event emitted when the voting period is set event VotingPeriodSet(uint oldVotingPeriod, uint newVotingPeriod); /// @notice Emitted when implementation is changed event NewImplementation(address oldImplementation, address newImplementation); + // TODO: delete /// @notice Emitted when proposal threshold is set event ProposalThresholdSet(uint oldProposalThreshold, uint newProposalThreshold); @@ -41,9 +47,11 @@ contract GovernorBravoEvents { /// @notice Emitted when pendingAdmin is accepted, which means admin is updated event NewAdmin(address oldAdmin, address newAdmin); + // TODO: delete /// @notice Emitted when whitelist account expiration is set event WhitelistAccountExpirationSet(address account, uint expiration); + // TODO: delete /// @notice Emitted when the whitelistGuardian is set event WhitelistGuardianSet(address oldGuardian, address newGuardian); } @@ -68,12 +76,15 @@ contract GovernorBravoDelegatorStorage { */ contract GovernorBravoDelegateStorageV1 is GovernorBravoDelegatorStorage { + // TODO: delete /// @notice The delay before voting on a proposal may take place, once proposed, in blocks uint public votingDelay; + // TODO: delete /// @notice The duration of voting on a proposal, in blocks uint public votingPeriod; + // TODO: delete /// @notice The number of votes required in order for a voter to become a proposer uint public proposalThreshold; @@ -86,6 +97,7 @@ contract GovernorBravoDelegateStorageV1 is GovernorBravoDelegatorStorage { /// @notice The address of the Compound Protocol Timelock TimelockInterface public timelock; + // TODO: need to replace with Canto EIP-20 Interfance /// @notice The address of the Compound governance token CompInterface public comp; @@ -118,18 +130,23 @@ contract GovernorBravoDelegateStorageV1 is GovernorBravoDelegatorStorage { /// @notice The ordered list of calldata to be passed to each call bytes[] calldatas; + // TODO: delete startBlock /// @notice The block at which voting begins: holders must delegate their votes prior to this block uint startBlock; + // TODO: delete endBlock /// @notice The block at which voting ends: votes must be cast prior to this block uint endBlock; + // TODO: delete /// @notice Current number of votes in favor of this proposal uint forVotes; - + + // TODO: delete /// @notice Current number of votes in opposition to this proposal uint againstVotes; + // TODO: delete /// @notice Current number of votes for abstaining for this proposal uint abstainVotes; @@ -143,6 +160,7 @@ contract GovernorBravoDelegateStorageV1 is GovernorBravoDelegatorStorage { mapping (address => Receipt) receipts; } + // TODO: delete Receipt /// @notice Ballot receipt record for a voter struct Receipt { /// @notice Whether or not a vote has been cast @@ -155,6 +173,7 @@ contract GovernorBravoDelegateStorageV1 is GovernorBravoDelegatorStorage { uint96 votes; } + // TODO: delete PENDING, DEFEATED, Canceled, Active, Succeeded /// @notice Possible states that a proposal may be in enum ProposalState { Pending, @@ -167,7 +186,7 @@ contract GovernorBravoDelegateStorageV1 is GovernorBravoDelegatorStorage { Executed } } - +// TODO: delete GovernorBravoDelegateStorageV2 and replace all extensions with GovernorBravoDelegateStorageV1 contract GovernorBravoDelegateStorageV2 is GovernorBravoDelegateStorageV1 { /// @notice Stores the expiration of account whitelist status as a timestamp mapping (address => uint) public whitelistAccountExpirations; @@ -186,6 +205,7 @@ interface TimelockInterface { function executeTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external payable returns (bytes memory); } +// TODO: delete this interface CompInterface { function getPriorVotes(address account, uint blockNumber) external view returns (uint96); } diff --git a/contracts/Lens/CompoundLens.sol b/contracts/Lens/CompoundLens.sol index feda52478..7efc477ab 100644 --- a/contracts/Lens/CompoundLens.sol +++ b/contracts/Lens/CompoundLens.sol @@ -22,6 +22,7 @@ interface ComptrollerLensInterface { } interface GovernorBravoInterface { + // TODO: delete receipt struct Receipt { bool hasVoted; uint8 support; @@ -31,6 +32,7 @@ interface GovernorBravoInterface { uint id; address proposer; uint eta; + // TODO: delete startBlock, endBlock, forVotes, againstVotes, abstainVotes uint startBlock; uint endBlock; uint forVotes; @@ -41,6 +43,7 @@ interface GovernorBravoInterface { } function getActions(uint proposalId) external view returns (address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas); function proposals(uint proposalId) external view returns (Proposal memory); + // TODO: delete getReceipt function getReceipt(uint proposalId, address voter) external view returns (Receipt memory); } @@ -255,13 +258,15 @@ contract CompoundLens { }); } + // TODO: delete struct GovReceipt { uint proposalId; bool hasVoted; bool support; uint96 votes; } - + + // TODO: delete function getGovReceipts(GovernorAlpha governor, address voter, uint[] memory proposalIds) public view returns (GovReceipt[] memory) { uint proposalCount = proposalIds.length; GovReceipt[] memory res = new GovReceipt[](proposalCount); @@ -277,6 +282,7 @@ contract CompoundLens { return res; } + // TODO: delete struct GovBravoReceipt { uint proposalId; bool hasVoted; @@ -284,6 +290,7 @@ contract CompoundLens { uint96 votes; } + // TODO: delete function getGovBravoReceipts(GovernorBravoInterface governor, address voter, uint[] memory proposalIds) public view returns (GovBravoReceipt[] memory) { uint proposalCount = proposalIds.length; GovBravoReceipt[] memory res = new GovBravoReceipt[](proposalCount); @@ -299,6 +306,7 @@ contract CompoundLens { return res; } + // TODO: delete struct GovProposal { uint proposalId; address proposer; @@ -315,6 +323,7 @@ contract CompoundLens { bool executed; } + // TODO: delete function setProposal(GovProposal memory res, GovernorAlpha governor, uint proposalId) internal view { ( , @@ -338,6 +347,7 @@ contract CompoundLens { res.executed = executed; } + // TODO: delete function getGovProposals(GovernorAlpha governor, uint[] calldata proposalIds) external view returns (GovProposal[] memory) { GovProposal[] memory res = new GovProposal[](proposalIds.length); for (uint i = 0; i < proposalIds.length; i++) { @@ -375,11 +385,11 @@ contract CompoundLens { uint[] values; string[] signatures; bytes[] calldatas; - uint startBlock; - uint endBlock; - uint forVotes; - uint againstVotes; - uint abstainVotes; + uint startBlock; // TODO: delete + uint endBlock; // TODO: delete + uint forVotes; // TODO: delete + uint againstVotes; // TODO: delete + uint abstainVotes; // TODO: delete bool canceled; bool executed; } @@ -390,11 +400,11 @@ contract CompoundLens { res.proposalId = proposalId; res.proposer = p.proposer; res.eta = p.eta; - res.startBlock = p.startBlock; - res.endBlock = p.endBlock; - res.forVotes = p.forVotes; - res.againstVotes = p.againstVotes; - res.abstainVotes = p.abstainVotes; + res.startBlock = p.startBlock; // TODO: delete + res.endBlock = p.endBlock; // TODO: delete + res.forVotes = p.forVotes; // TODO: delete + res.againstVotes = p.againstVotes; // TODO: delete + res.abstainVotes = p.abstainVotes; // TODO: delete res.canceled = p.canceled; res.executed = p.executed; } @@ -416,11 +426,11 @@ contract CompoundLens { values: values, signatures: signatures, calldatas: calldatas, - startBlock: 0, - endBlock: 0, - forVotes: 0, - againstVotes: 0, - abstainVotes: 0, + startBlock: 0, // TODO: delete + endBlock: 0, // TODO: delete + forVotes: 0, // TODO: delete + againstVotes: 0, // TODO: delete + abstainVotes: 0, // TODO: delete canceled: false, executed: false }); @@ -431,23 +441,23 @@ contract CompoundLens { struct CompBalanceMetadata { uint balance; - uint votes; - address delegate; + uint votes; // TODO: delete + address delegate; // TODO: delete } function getCompBalanceMetadata(Comp comp, address account) external view returns (CompBalanceMetadata memory) { return CompBalanceMetadata({ balance: comp.balanceOf(account), - votes: uint256(comp.getCurrentVotes(account)), - delegate: comp.delegates(account) + votes: uint256(comp.getCurrentVotes(account)), // TODO: delete + delegate: comp.delegates(account) // TODO: delete }); } struct CompBalanceMetadataExt { - uint balance; - uint votes; - address delegate; - uint allocated; + uint balance; + uint votes; // TODO: delete + address delegate; // TODO: delete + uint allocated; } function getCompBalanceMetadataExt(Comp comp, ComptrollerLensInterface comptroller, address account) external returns (CompBalanceMetadataExt memory) { @@ -460,17 +470,19 @@ contract CompoundLens { return CompBalanceMetadataExt({ balance: balance, - votes: uint256(comp.getCurrentVotes(account)), - delegate: comp.delegates(account), + votes: uint256(comp.getCurrentVotes(account)), // TODO: delete + delegate: comp.delegates(account), // TODO: delete allocated: allocated }); } + // TODO: delete struct CompVotes { uint blockNumber; uint votes; } + // TODO: delete function getCompVotes(Comp comp, address account, uint32[] calldata blockNumbers) external view returns (CompVotes[] memory) { CompVotes[] memory res = new CompVotes[](blockNumbers.length); for (uint i = 0; i < blockNumbers.length; i++) { diff --git a/contracts/SimplePriceOracle.sol b/contracts/SimplePriceOracle.sol index db9658f37..2474548cd 100644 --- a/contracts/SimplePriceOracle.sol +++ b/contracts/SimplePriceOracle.sol @@ -6,7 +6,8 @@ import "./CErc20.sol"; contract SimplePriceOracle is PriceOracle { mapping(address => uint) prices; event PricePosted(address asset, uint previousPriceMantissa, uint requestedPriceMantissa, uint newPriceMantissa); - + + // TODO: probably need to modify "cETH" logic below function _getUnderlyingAddress(CToken cToken) private view returns (address) { address asset; if (compareStrings(cToken.symbol(), "cETH")) { diff --git a/contracts/Timelock.sol b/contracts/Timelock.sol index 5cda36d2b..0a5e81bf0 100644 --- a/contracts/Timelock.sol +++ b/contracts/Timelock.sol @@ -12,6 +12,7 @@ contract Timelock { event ExecuteTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta); event QueueTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta); + // TODO: probably want to change the delay duration here uint public constant GRACE_PERIOD = 14 days; uint public constant MINIMUM_DELAY = 2 days; uint public constant MAXIMUM_DELAY = 30 days; diff --git a/nethereum-gen.settings b/nethereum-gen.settings new file mode 100644 index 000000000..aeac34364 --- /dev/null +++ b/nethereum-gen.settings @@ -0,0 +1,7 @@ +{ + "projectName": "CantoCompoundProtocol", + "namespace": "CantoCompoundProtocol.Contracts", + "lang": 0, + "autoCodeGen": true, + "projectPath": "../" +} \ No newline at end of file