Skip to content

Latest commit

 

History

History
343 lines (288 loc) · 9.26 KB

BondPoolBase.md

File metadata and controls

343 lines (288 loc) · 9.26 KB

BondPoolBase.sol

View Source: contracts/pool/Bond/BondPoolBase.sol

↗ Extends: IBondPool, Recoverable ↘ Derived Contracts: BondPool

BondPoolBase

Functions

function (IStore s) internal nonpayable Recoverable 

Arguments

Name Type Description
s IStore
Source Code
constructor(IStore s) Recoverable(s) {}

getNpmMarketPrice

function getNpmMarketPrice() external view
returns(uint256)

Arguments

Name Type Description
Source Code
function getNpmMarketPrice() external view override returns (uint256) {
    return s.getNpmPriceInternal(1 ether);
  }

calculateTokensForLp

function calculateTokensForLp(uint256 lpTokens) external view
returns(uint256)

Arguments

Name Type Description
lpTokens uint256
Source Code
function calculateTokensForLp(uint256 lpTokens) external view override returns (uint256) {
    return s.calculateTokensForLpInternal(lpTokens);
  }

getInfo

Gets the bond pool information

function getInfo(address forAccount) external view
returns(struct IBondPool.BondPoolInfoType)

Arguments

Name Type Description
forAccount address
Source Code
function getInfo(address forAccount) external view override returns (BondPoolInfoType memory) {
    return s.getBondPoolInfoInternal(forAccount);
  }

setup

Sets up the bond pool

function setup(struct IBondPool.SetupBondPoolArgs args) external nonpayable nonReentrant 

Arguments

Name Type Description
args struct IBondPool.SetupBondPoolArgs
Source Code
function setup(SetupBondPoolArgs calldata args) external override nonReentrant {
    // @suppress-zero-value-check The uint values are checked in the function `setupBondPoolInternal`
    s.mustNotBePaused();
    AccessControlLibV1.mustBeLiquidityManager(s);

    s.setupBondPoolInternal(args);

    emit BondPoolSetup(args);
  }

version

Version number of this contract

function version() external pure
returns(bytes32)

Arguments

Name Type Description
Source Code
function version() external pure override returns (bytes32) {
    return "v0.1";
  }

getName

Name of this contract

function getName() external pure
returns(bytes32)

Arguments

Name Type Description
Source Code
function getName() external pure override returns (bytes32) {
    return ProtoUtilV1.CNAME_BOND_POOL;
  }

Contracts