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

Moved adjust total supply checkpoints inside of create checkpoint #520 #523

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions contracts/tokens/SecurityToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,6 @@ contract SecurityToken is ERC20, ERC20Detailed, ReentrancyGuard, RegistryUpdater
returns(bool success)
{
require(_updateTransfer(address(0), _investor, _value, _data), "Transfer invalid");
_adjustTotalSupplyCheckpoints();
_mint(_investor, _value);
emit Minted(_investor, _value);
return true;
Expand Down Expand Up @@ -692,7 +691,6 @@ contract SecurityToken is ERC20, ERC20Detailed, ReentrancyGuard, RegistryUpdater

function _checkAndBurn(address _from, uint256 _value, bytes memory _data) internal returns(bool) {
bool verified = _updateTransfer(_from, address(0), _value, _data);
_adjustTotalSupplyCheckpoints();
_burn(_from, _value);
emit Burnt(_from, _value);
return verified;
Expand All @@ -709,7 +707,6 @@ contract SecurityToken is ERC20, ERC20Detailed, ReentrancyGuard, RegistryUpdater

function _checkAndBurnFrom(address _from, uint256 _value, bytes memory _data) internal returns(bool) {
bool verified = _updateTransfer(_from, address(0), _value, _data);
_adjustTotalSupplyCheckpoints();
_burnFrom(_from, _value);
emit Burnt(_from, _value);
return verified;
Expand All @@ -735,6 +732,7 @@ contract SecurityToken is ERC20, ERC20Detailed, ReentrancyGuard, RegistryUpdater
/*solium-disable-next-line security/no-block-members*/
checkpointTimes.push(now);
/*solium-disable-next-line security/no-block-members*/
_adjustTotalSupplyCheckpoints();
emit CheckpointCreated(currentCheckpointId, now);
return currentCheckpointId;
}
Expand Down