August 2019
Intermediate to advanced
486 pages
13h 52m
English
When your token needs to have controlled transfer of tokens, you can use the ERC20Pausable.sol contract. This gives the owner of the contract the right to pause or unpause token transfers and approvals. When token transfers are paused, anyone holding the token cannot make transfer(), transferFrom(), approve(), increaseApproval(), or decreaseApproval() function calls, and calls to these functions would fail. However, when the token is in the unpaused state, these function calls are allowed.
The OpenZeppelin contract present at Chapter09/openzeppelin-solidity/contracts/token/ERC20/ERC20Pausable.sol is defined as follows:
import "./ERC20.sol";import "../../lifecycle/Pausable.sol";contract ERC20Pausable ...