0.5.0 • Published 5 years ago

curve-bonded-tokens v0.5.0

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

curve-bonded-tokens

These contracts have not been audited, use at your own risk

Curve Bonded tokens based on the Bancor Formula and OpenZeppelin contracts

Install

npm install curve-bonded-tokens

Usage

Eth-backed bonded token:

pragma solidity ^0.4.24;

import "curve-bonded-tokens/contracts/EthBondingToken.sol";

contract Token is EthBondingToken {
  uint256 public constant INITIAL_SUPPLY = 1000000 * (10 ** 18);
  uint32 public constant RESERVE_RATIO = 150000;
  uint256 public constant GAS_PRICE = 50 * (10 ** 10);

  constructor() public {
    EthBondingToken.initialize(INITIAL_SUPPLY, RESERVE_RATIO, _gasPrice);
  }
}

ERC20-backed bonded token:

pragma solidity ^0.4.24;

import "openzeppelin-eth/contracts/token/ERC20/ERC20.sol";
import "curve-bonded-tokens/contracts/ERC20BondingToken.sol";

contract Token is ERC20BondingToken {
  uint256 public constant INITIAL_POOL_BALANCE = 1 * (10 ** 18);
  uint256 public constant INITIAL_SUPPLY = 1000000 * (10 ** 18);
  uint32 public constant RESERVE_RATIO = 150000;
  uint256 public constant GAS_PRICE = 50 * (10 ** 10);

  constructor(ERC20 _reserveToken) public {
    ERC20BondingToken.initialize(
      _reserveToken,
      INITIAL_POOL_BALANCE,
      INITIAL_SUPPLY,
      RESERVE_RATIO,
      GAS_PRICE
    );
  }
}
0.5.0

5 years ago

0.4.0

5 years ago

0.3.0

6 years ago

0.2.5

6 years ago

0.2.4

6 years ago

0.2.3

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.12

6 years ago

0.1.11

6 years ago

0.1.10

6 years ago

0.1.9

6 years ago

0.1.8

6 years ago

0.1.7

6 years ago

0.1.6

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago