Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
openzeppelin-contracts-upgradeable
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
俞永鹏
openzeppelin-contracts-upgradeable
Commits
20187f29
Commit
20187f29
authored
Sep 07, 2017
by
Francisco Giordano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use SafeERC20#safeTransfer
parent
dcdc453a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
CanReclaimToken.sol
contracts/ownership/CanReclaimToken.sol
+3
-1
TokenTimelock.sol
contracts/token/TokenTimelock.sol
+3
-1
No files found.
contracts/ownership/CanReclaimToken.sol
View file @
20187f29
...
@@ -2,6 +2,7 @@ pragma solidity ^0.4.11;
...
@@ -2,6 +2,7 @@ pragma solidity ^0.4.11;
import "./Ownable.sol";
import "./Ownable.sol";
import "../token/ERC20Basic.sol";
import "../token/ERC20Basic.sol";
import "../token/SafeERC20.sol";
/**
/**
* @title Contracts that should be able to recover tokens
* @title Contracts that should be able to recover tokens
...
@@ -10,6 +11,7 @@ import "../token/ERC20Basic.sol";
...
@@ -10,6 +11,7 @@ import "../token/ERC20Basic.sol";
* This will prevent any accidental loss of tokens.
* This will prevent any accidental loss of tokens.
*/
*/
contract CanReclaimToken is Ownable {
contract CanReclaimToken is Ownable {
using SafeERC20 for ERC20Basic;
/**
/**
* @dev Reclaim all ERC20Basic compatible tokens
* @dev Reclaim all ERC20Basic compatible tokens
...
@@ -17,7 +19,7 @@ contract CanReclaimToken is Ownable {
...
@@ -17,7 +19,7 @@ contract CanReclaimToken is Ownable {
*/
*/
function reclaimToken(ERC20Basic token) external onlyOwner {
function reclaimToken(ERC20Basic token) external onlyOwner {
uint256 balance = token.balanceOf(this);
uint256 balance = token.balanceOf(this);
token.
t
ransfer(owner, balance);
token.
safeT
ransfer(owner, balance);
}
}
}
}
contracts/token/TokenTimelock.sol
View file @
20187f29
...
@@ -2,6 +2,7 @@ pragma solidity ^0.4.11;
...
@@ -2,6 +2,7 @@ pragma solidity ^0.4.11;
import './ERC20Basic.sol';
import './ERC20Basic.sol';
import "../token/SafeERC20.sol";
/**
/**
* @title TokenTimelock
* @title TokenTimelock
...
@@ -9,6 +10,7 @@ import './ERC20Basic.sol';
...
@@ -9,6 +10,7 @@ import './ERC20Basic.sol';
* beneficiary to extract the tokens after a given release time
* beneficiary to extract the tokens after a given release time
*/
*/
contract TokenTimelock {
contract TokenTimelock {
using SafeERC20 for ERC20Basic;
// ERC20 basic token contract being held
// ERC20 basic token contract being held
ERC20Basic token;
ERC20Basic token;
...
@@ -44,6 +46,6 @@ contract TokenTimelock {
...
@@ -44,6 +46,6 @@ contract TokenTimelock {
uint256 amount = token.balanceOf(this);
uint256 amount = token.balanceOf(this);
require(amount > 0);
require(amount > 0);
token.
t
ransfer(beneficiary, amount);
token.
safeT
ransfer(beneficiary, amount);
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment