[Ethereum] How to user SafeERC20 from zeppelin-solidity

erc-20openzeppelinsolidityuser-safety

I am trying to utilize the SafeERC20 library from zeppelin-solidity.
However the instructions for using the library are not sufficient for a novice like me .
Please help me in understanding .
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure.
+ * To use this library you can add a using SafeERC20 for ERC20; statement to your contract,
+ * which allows you to call the safe operations as token.safeTransfer(...), etc.*/ when I utilize it in my Contract token program , How shall I use it ?
code is available here https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/token/ERC20/SafeERC20.sol
enter image description here

below is the code .
https://gist.github.com/bhattnaval/2eea6398fab22e64140bef930243bacd

Best Answer

The library SafeERC20 is to safely interact with a third party token. It is not to be used inside your own token contract.

OpenZeppelin contracts already have require to check for preconditions so they will return true or fail early.

Also I'd suggest to remove the protection for short address attack onlyPayloadSize. They were removed from the OpenZeppelin contracts several months ago #261 Remove short address attack checks from tokens.

Related Topic