mirror of
https://github.com/tornadocash/tornado-governance
synced 2024-02-02 14:53:55 +01:00
Merge pull request #1 from h-ivor/master
Add virtual keywords for Governance upgrade proposal.
This commit is contained in:
commit
77ce3c96d4
@ -47,7 +47,7 @@ abstract contract Delegation is Core {
|
||||
address[] memory from,
|
||||
uint256 proposalId,
|
||||
bool support
|
||||
) external {
|
||||
) external virtual {
|
||||
for (uint256 i = 0; i < from.length; i++) {
|
||||
require(delegatedTo[from[i]] == msg.sender, "Governance: not authorized");
|
||||
_castVote(from[i], proposalId, support);
|
||||
|
@ -113,7 +113,7 @@ contract Governance is Initializable, Configuration, Delegation, EnsResolve {
|
||||
_transferTokens(msg.sender, amount);
|
||||
}
|
||||
|
||||
function unlock(uint256 amount) external {
|
||||
function unlock(uint256 amount) external virtual {
|
||||
require(getBlockTimestamp() > canWithdrawAfter[msg.sender], "Governance: tokens are locked");
|
||||
lockedBalance[msg.sender] = lockedBalance[msg.sender].sub(amount, "Governance: insufficient balance");
|
||||
require(torn.transfer(msg.sender, amount), "TORN: transfer failed");
|
||||
@ -191,7 +191,7 @@ contract Governance is Initializable, Configuration, Delegation, EnsResolve {
|
||||
emit ProposalExecuted(proposalId);
|
||||
}
|
||||
|
||||
function castVote(uint256 proposalId, bool support) external {
|
||||
function castVote(uint256 proposalId, bool support) external virtual {
|
||||
_castVote(msg.sender, proposalId, support);
|
||||
}
|
||||
|
||||
@ -241,7 +241,7 @@ contract Governance is Initializable, Configuration, Delegation, EnsResolve {
|
||||
}
|
||||
}
|
||||
|
||||
function _transferTokens(address owner, uint256 amount) internal {
|
||||
function _transferTokens(address owner, uint256 amount) internal virtual {
|
||||
require(torn.transferFrom(owner, address(this), amount), "TORN: transferFrom failed");
|
||||
lockedBalance[owner] = lockedBalance[owner].add(amount);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user