-
Notifications
You must be signed in to change notification settings - Fork 11.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ERC20 token with snapshoting mechanism (#1209) #1331
Closed
jbogacz
wants to merge
34
commits into
OpenZeppelin:master
from
jbogacz:fix/ERC20-token-with-snapshots-#1209
Closed
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
3b66e70
Add ERC20 token with snapshoting mechanism (#1209)
1302e6a
Methods visibility corrected
jbogacz 21198bf
Roles now emit events in construction and when renouncing. (#1329)
nventuro 396680b
Add the missing test for ERC721Holder (#1249)
db2e1d2
Removed assertions from Escrow and SplitPayment. (#1349)
nventuro 5fdeaa8
Removed mintingFinished. (#1351)
nventuro ae109f6
Improved bounty tests. (#1350)
nventuro 947de54
Add BigNumber support to expectEvent/inLogs (#1026) (#1338)
jbogacz 75c0a59
Add missing tests to ECSDA (#1248)
536262f
Feature/use expect event in test logs assertions #1232 (#1343)
jbogacz 1a4e534
Add SignatureBouncer test for when msg.data is too short (#1360)
frangio a688977
Dangling commas are now required. (#1359)
nventuro fa1dfbd
Fix #1358 Test helper to send funds (#1367)
Aniket-Engg 6ae041b
Fix/#1355 test helper to check balance difference (#1368)
Aniket-Engg 34bc709
Merged latestTime, increaseTime and duration into a time helper. (#1364)
nventuro 269981e
Created test utils directory
nventuro f4d6f40
Fixed test path.
nventuro 43ebb4f
ERC20 internal transfer method (#1370)
k06a f3888bb
Removing unrequired `_burn()` override (#1373)
Aniket-Engg c87433e
Prevents Bounty from being claimed twice (#1374)
Aniket-Engg 5c22880
Update issue templates (#1376)
frangio ace14d3
Add note about compiling artifacts to releasing steps (#1377)
frangio fd4de77
Replaces `amount` with `value` for consistency (#1378)
Aniket-Engg b41b125
`this` is used in tests (#1380)
Aniket-Engg 744f567
Separate ERC721Mintable (#1365)
frangio 308e5e9
Removed unnecessary Secondary inheritance from RefundEscrow. (#1381)
nventuro b17de01
Removed old, unused mocks. (#1382)
nventuro 41f84f8
Removed selfdestruct from BreakInvariantBounty (#1385)
Aniket-Engg f7e53d9
Add Arrays library with unit tests (#1209) (#1375)
jbogacz 3acc2b4
Added a constructor to BreakInvariantBounty. (#1395)
nventuro aa6b6d0
Add ERC20 token with snapshoting mechanism (#1209)
7f59f86
Methods visibility corrected
jbogacz 360c85e
Use SafeMath.
jbogacz 474ec3d
Merge branch 'fix/ERC20-token-with-snapshots-#1209' of https://githubβ¦
jbogacz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 was deleted.
Oops, something went wrong.
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,21 @@ | ||
--- | ||
name: Bug report | ||
about: Report a bug in OpenZeppelin | ||
|
||
--- | ||
|
||
<!-- Briefly describe the issue you're experiencing. Tell us what you were trying to do and what happened instead. --> | ||
|
||
<!-- Remember, this is not a place to ask for help debugging code. For that, we welcome you in the OpenZeppelin Slack channel: https://slack.openzeppelin.org/. --> | ||
|
||
**π» Environment** | ||
|
||
<!-- Tell us what version of OpenZeppelin you're using, and how you're using it: Truffle, Remix, etc. --> | ||
|
||
**π Details** | ||
|
||
<!-- Describe the problem you have been experiencing in more detail. Include as much information as you think is relevant. Keep in mind that transactions can fail for many reasons; context is key here. --> | ||
|
||
**π’ Code to reproduce bug** | ||
|
||
<!-- We will be able to better help if you provide a minimal example that triggers the bug. --> |
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,14 @@ | ||
--- | ||
name: Feature request | ||
about: Suggest an idea for OpenZeppelin | ||
|
||
--- | ||
|
||
**π§ Motivation** | ||
<!-- Is your feature request related to a specific problem? Is it just a crazy idea? Tell us about it! --> | ||
|
||
**π Details** | ||
<!-- Please describe your feature request in detail. --> | ||
|
||
<!-- Make sure that you have reviewed the OpenZeppelin Contributor Guidelines. --> | ||
<!-- https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/CONTRIBUTING.md --> |
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,17 +1,20 @@ | ||
<!-- 0. π Thank you for submitting a PR! --> | ||
|
||
<!-- 1. **Does this close any open issues?** If so, list them here. If not, remove the `Fixes #` line. --> | ||
<!-- 1. Does this close any open issues? Please list them below. --> | ||
|
||
Fixes # | ||
<!-- Keep in mind that new features have a better chance of being merged fast if | ||
they were first discussed and designed with the maintainers. If there is no | ||
corresponding issue, please consider opening one for discussion first! --> | ||
|
||
# π Description | ||
Fixes # | ||
|
||
<!-- 2. Describe the changes introduced in this pull request --> | ||
<!-- 2. Describe the changes introduced in this pull request. --> | ||
<!-- Include any context necessary for understanding the PR's purpose. --> | ||
|
||
<!-- 3. Before submitting, please review the following checklist: --> | ||
|
||
- [ ] π I've reviewed the [OpenZeppelin Contributor Guidelines](../blob/master/CONTRIBUTING.md) | ||
- [ ] β I've added tests where applicable to test my new functionality. | ||
- [ ] π I've made sure that my contracts are well-documented. | ||
- [ ] π¨ I've run the JS/Solidity linters and fixed any issues (`npm run lint:fix`). | ||
<!-- 3. Before submitting, please make sure that you have: | ||
- reviewed the OpenZeppelin Contributor Guidelines | ||
(https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/CONTRIBUTING.md), | ||
- added tests where applicable to test new functionality, | ||
- made sure that your contracts are well-documented, and | ||
- run the JS/Solidity linters and fixed any issues (`npm run lint:fix`). | ||
--> |
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
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,18 @@ | ||
pragma solidity ^0.4.24; | ||
|
||
import "../utils/Arrays.sol"; | ||
|
||
contract ArraysImpl { | ||
|
||
using Arrays for uint256[]; | ||
|
||
uint256[] private array; | ||
|
||
constructor(uint256[] _array) public { | ||
array = _array; | ||
} | ||
|
||
function findUpperBound(uint256 _element) external view returns (uint256) { | ||
return array.findUpperBound(_element); | ||
} | ||
} |
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,19 @@ | ||
pragma solidity ^0.4.24; | ||
|
||
import "../token/ERC20/ERC20Snapshot.sol"; | ||
|
||
|
||
contract ERC20SnapshotMock is ERC20Snapshot { | ||
|
||
constructor(address initialAccount, uint256 initialBalance) public { | ||
_mint(initialAccount, initialBalance); | ||
} | ||
|
||
function mint(address account, uint256 amount) public { | ||
_mint(account, amount); | ||
} | ||
|
||
function burn(address account, uint256 amount) public { | ||
_burn(account, amount); | ||
} | ||
} | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does not include
_burnFrom
from the current v2 RC2 OZThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a mock for unit test purpose so I don't know if this even need
mint
andburn
functions.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
burn
andmint
functions (andburnFrom
) impact the total supply. Which is important to keep history of for specific purposes.Examples include:
Voting Power
Dividend Share
Which both are dependent on the ratio of held tokens at a specified time. In which knowing the total supply is necessary.