Skip to content
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

R1 - snapshot is called unnecessarily too often #247

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -218,7 +218,7 @@ An ERC20Guild with the functionality to migrate the ERC20 voting token used, the

#### SnapshotERC20Guild

An ERC20Guild that keeps track of the voting power by saving a snapshot of the voting power each time a lock/withdraw of tokens happens. The voting power to be used on a proposal would be the one that the guild had at the moment of the proposal creation.
An ERC20Guild that keeps track of the voting power by saving a snapshot of the voting power each time a mint/burn of tokens happens. The voting power to be used on a proposal would be the one that the guild had at the moment of the proposal creation.

#### SnapshotERC20REPGuild

Expand Down
4 changes: 1 addition & 3 deletions contracts/dao/DAOReputation.sol
Expand Up @@ -8,7 +8,7 @@ import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20Snapshot
* @title DAO Reputation
* @dev An ERC20 token that is non-transferable, owned and controlled by the DAO.
* Used by the DAO to vote on proposals.
* It uses a snapshot mechanism to keep track of the reputation at the moment of each proposal creation.
* It uses a snapshot mechanism to keep track of the reputation at the moment of each modification of the supply of the token (every mint an burn).
*/
contract DAOReputation is OwnableUpgradeable, ERC20SnapshotUpgradeable {
event Mint(address indexed _to, uint256 _amount);
Expand Down Expand Up @@ -42,7 +42,6 @@ contract DAOReputation is OwnableUpgradeable, ERC20SnapshotUpgradeable {
function mintMultiple(address[] memory _accounts, uint256[] memory _amount) external onlyOwner returns (bool) {
for (uint256 i = 0; i < _accounts.length; i++) {
_mint(_accounts[i], _amount[i]);
_snapshot();
emit Mint(_accounts[i], _amount[i]);
}
return true;
Expand All @@ -62,7 +61,6 @@ contract DAOReputation is OwnableUpgradeable, ERC20SnapshotUpgradeable {
function burnMultiple(address[] memory _accounts, uint256 _amount) external onlyOwner returns (bool) {
for (uint256 i = 0; i < _accounts.length; i++) {
_burn(_accounts[i], _amount);
_snapshot();
rulfo71 marked this conversation as resolved.
Show resolved Hide resolved
emit Burn(_accounts[i], _amount);
}
return true;
Expand Down