-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
174 additions
and
7 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
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,35 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8; | ||
|
||
import "openzeppelin-contracts/contracts/token/ERC20/ERC20.sol"; | ||
import "openzeppelin-contracts/contracts/token/ERC20/extensions/ERC20Permit.sol"; | ||
import "openzeppelin-contracts/contracts/token/ERC20/extensions/ERC20Votes.sol"; | ||
|
||
contract GovernableERC20 is ERC20, ERC20Permit, ERC20Votes { | ||
constructor( | ||
string memory _name, | ||
string memory _symbol, | ||
uint256 _totalSupply, | ||
address _receiver | ||
) ERC20(_name, _symbol) ERC20Permit(_name) { | ||
_mint(_receiver, _totalSupply); | ||
} | ||
|
||
// Default to self-delegation if no delegate is set. This enables snapshots | ||
// to work as expected, otherwise when transferring votes to undelegated addresses | ||
// the votes would not be moved (see `Votes._moveDelegateVotes`). | ||
function delegates(address account) public view override returns (address) { | ||
address delegate = super.delegates(account); | ||
return delegate == address(0) ? account : delegate; | ||
} | ||
|
||
// The following functions are overrides required by Solidity. | ||
|
||
function _update(address from, address to, uint256 value) internal override(ERC20, ERC20Votes) { | ||
super._update(from, to, value); | ||
} | ||
|
||
function nonces(address owner) public view override(ERC20Permit, Nonces) returns (uint256) { | ||
return super.nonces(owner); | ||
} | ||
} |
Submodule forge-std
updated
26 files
+1 −0 | .gitattributes | |
+0 −4 | .github/workflows/ci.yml | |
+1 −1 | package.json | |
+635 −0 | scripts/vm.py | |
+1 −1 | src/Script.sol | |
+25 −4 | src/StdChains.sol | |
+111 −10 | src/StdCheats.sol | |
+15 −0 | src/StdInvariant.sol | |
+19 −15 | src/StdJson.sol | |
+244 −98 | src/StdStorage.sol | |
+61 −33 | src/StdUtils.sol | |
+1 −2 | src/Test.sol | |
+981 −376 | src/Vm.sol | |
+234 −0 | src/mocks/MockERC20.sol | |
+235 −0 | src/mocks/MockERC721.sol | |
+93 −77 | test/StdAssertions.t.sol | |
+95 −37 | test/StdChains.t.sol | |
+134 −60 | test/StdCheats.t.sol | |
+13 −11 | test/StdError.t.sol | |
+27 −12 | test/StdMath.t.sol | |
+222 −42 | test/StdStorage.t.sol | |
+4 −4 | test/StdStyle.t.sol | |
+66 −36 | test/StdUtils.t.sol | |
+15 −0 | test/Vm.t.sol | |
+441 −0 | test/mocks/MockERC20.t.sol | |
+721 −0 | test/mocks/MockERC721.t.sol |
Submodule party-addresses
updated
310 files
Submodule v2-periphery
added at
0335e8
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,3 +1,7 @@ | ||
forge-std/=lib/forge-std/src/ | ||
openzeppelin/=lib/openzeppelin-contracts/ | ||
solmate/=lib/solmate/src/ | ||
solmate/=lib/solmate/src/ | ||
ds-test/=lib/forge-std/lib/ds-test/src/ | ||
party-addresses/=lib/party-addresses/ | ||
uniswap-v2-core/=lib/v2-core/contracts/ | ||
uniswap-v2-periphery/=lib/v2-periphery/contracts/ |