adapt contracts for upgradeability
This commit is contained in:
@ -1,14 +1,14 @@
|
||||
pragma solidity ^0.4.21;
|
||||
|
||||
import "./ERC20.sol";
|
||||
import 'zos-lib/contracts/migrations/Migratable.sol';
|
||||
|
||||
|
||||
contract DetailedERC20 is ERC20 {
|
||||
contract DetailedERC20 is Migratable, ERC20 {
|
||||
string public name;
|
||||
string public symbol;
|
||||
uint8 public decimals;
|
||||
|
||||
function DetailedERC20(string _name, string _symbol, uint8 _decimals) public {
|
||||
function initialize(address _sender, string _name, string _symbol, uint8 _decimals) public isInitializer("DetailedERC20", "0") {
|
||||
name = _name;
|
||||
symbol = _symbol;
|
||||
decimals = _decimals;
|
||||
|
||||
@ -2,7 +2,7 @@ pragma solidity ^0.4.21;
|
||||
|
||||
import "./StandardToken.sol";
|
||||
import "../../ownership/Ownable.sol";
|
||||
|
||||
import "zos-lib/contracts/migrations/Migratable.sol";
|
||||
|
||||
/**
|
||||
* @title Mintable token
|
||||
@ -10,7 +10,7 @@ import "../../ownership/Ownable.sol";
|
||||
* @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120
|
||||
* Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
|
||||
*/
|
||||
contract MintableToken is StandardToken, Ownable {
|
||||
contract MintableToken is Migratable, Ownable, StandardToken {
|
||||
event Mint(address indexed to, uint256 amount);
|
||||
event MintFinished();
|
||||
|
||||
|
||||
@ -1,14 +1,14 @@
|
||||
pragma solidity ^0.4.21;
|
||||
|
||||
import "./SafeERC20.sol";
|
||||
|
||||
import "zos-lib/contracts/migrations/Migratable.sol";
|
||||
|
||||
/**
|
||||
* @title TokenTimelock
|
||||
* @dev TokenTimelock is a token holder contract that will allow a
|
||||
* beneficiary to extract the tokens after a given release time
|
||||
*/
|
||||
contract TokenTimelock {
|
||||
contract TokenTimelock is Migratable {
|
||||
using SafeERC20 for ERC20Basic;
|
||||
|
||||
// ERC20 basic token contract being held
|
||||
@ -20,7 +20,7 @@ contract TokenTimelock {
|
||||
// timestamp when token release is enabled
|
||||
uint256 public releaseTime;
|
||||
|
||||
function TokenTimelock(ERC20Basic _token, address _beneficiary, uint256 _releaseTime) public {
|
||||
function initialize(address _sender, ERC20Basic _token, address _beneficiary, uint256 _releaseTime) public isInitializer("TokenTimelock", "0") {
|
||||
// solium-disable-next-line security/no-block-members
|
||||
require(_releaseTime > block.timestamp);
|
||||
token = _token;
|
||||
|
||||
@ -6,6 +6,7 @@ import "./ERC20Basic.sol";
|
||||
import "./SafeERC20.sol";
|
||||
import "../../ownership/Ownable.sol";
|
||||
import "../../math/SafeMath.sol";
|
||||
import 'zos-lib/contracts/migrations/Migratable.sol';
|
||||
|
||||
|
||||
/**
|
||||
@ -14,7 +15,7 @@ import "../../math/SafeMath.sol";
|
||||
* typical vesting scheme, with a cliff and vesting period. Optionally revocable by the
|
||||
* owner.
|
||||
*/
|
||||
contract TokenVesting is Ownable {
|
||||
contract TokenVesting is Migratable, Ownable {
|
||||
using SafeMath for uint256;
|
||||
using SafeERC20 for ERC20Basic;
|
||||
|
||||
@ -42,7 +43,8 @@ contract TokenVesting is Ownable {
|
||||
* @param _duration duration in seconds of the period in which the tokens will vest
|
||||
* @param _revocable whether the vesting is revocable or not
|
||||
*/
|
||||
function TokenVesting(
|
||||
function initialize(
|
||||
address _sender,
|
||||
address _beneficiary,
|
||||
uint256 _start,
|
||||
uint256 _cliff,
|
||||
@ -50,7 +52,10 @@ contract TokenVesting is Ownable {
|
||||
bool _revocable
|
||||
)
|
||||
public
|
||||
isInitializer("TokenVesting", "0")
|
||||
{
|
||||
Ownable.initialize(_sender);
|
||||
|
||||
require(_beneficiary != address(0));
|
||||
require(_cliff <= _duration);
|
||||
|
||||
|
||||
@ -2,6 +2,7 @@ pragma solidity ^0.4.21;
|
||||
|
||||
import "./ERC721.sol";
|
||||
import "./ERC721BasicToken.sol";
|
||||
import "zos-lib/contracts/migrations/Migratable.sol";
|
||||
|
||||
|
||||
/**
|
||||
@ -10,7 +11,7 @@ import "./ERC721BasicToken.sol";
|
||||
* Moreover, it includes approve all functionality using operator terminology
|
||||
* @dev see https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
|
||||
*/
|
||||
contract ERC721Token is ERC721, ERC721BasicToken {
|
||||
contract ERC721Token is Migratable, ERC721, ERC721BasicToken {
|
||||
// Token name
|
||||
string internal name_;
|
||||
|
||||
@ -35,7 +36,7 @@ contract ERC721Token is ERC721, ERC721BasicToken {
|
||||
/**
|
||||
* @dev Constructor function
|
||||
*/
|
||||
function ERC721Token(string _name, string _symbol) public {
|
||||
function initialize(address _sender, string _name, string _symbol) public isInitializer("ERC721Token", "0") {
|
||||
name_ = _name;
|
||||
symbol_ = _symbol;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user