编译器
0.6.12+commit.27d51765
文件 1 的 17:Context.sol
pragma solidity ^0.6.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
文件 2 的 17:IAddressResolver.sol
pragma solidity ^0.6.12;
interface IAddressResolver {
function key2address(bytes32 key) external view returns(address);
function address2key(address addr) external view returns(bytes32);
function requireAndKey2Address(bytes32 name, string calldata reason) external view returns(address);
function setAddress(bytes32 key, address addr) external;
function setMultiAddress(bytes32[] memory keys, address[] memory addrs) external;
function setKkAddr(bytes32 k1, bytes32 k2, address addr) external;
function setMultiKKAddr(bytes32[] memory k1s, bytes32[] memory k2s, address[] memory addrs) external;
function kk2addr(bytes32 k1, bytes32 k2) external view returns(address);
function requireKKAddrs(bytes32 k1, bytes32 k2, string calldata reason) external view returns(address);
}
文件 3 的 17:IBoringDAO.sol
pragma solidity ^0.6.12;
interface IBoringDAO {
function pledge(bytes32 tunnelKey, uint _amount) external;
function redeem(bytes32 tunnelKey, uint _amount) external;
function approveMint(bytes32 tunnelKey, string memory _txid, uint _amount, address account, string memory assetAddress) external;
function burnBToken(bytes32 _tunnelKey, uint _amount, string memory assetAddress) external;
}
文件 4 的 17:IERC20.sol
pragma solidity ^0.6.0;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
文件 5 的 17:IFeePool.sol
pragma solidity ^0.6.12;
interface IFeePool {
function earned(address account) external view returns(uint, uint);
function notifyBORFeeAmount(uint amount) external;
function notifyBTokenFeeAmount(uint amount) external;
function notifyPTokenAmount(address account, uint amount) external;
function withdraw(address account, uint amount) external;
}
文件 6 的 17:ILiquidate.sol
pragma solidity ^0.6.12;
interface ILiquidate {
function liquidate(address account) external;
}
interface ILiquidateArray {
function liquidateArray(address account, uint256[] memory pids) external;
}
文件 7 的 17:IMintBurn.sol
pragma solidity ^0.6.12;
interface IMintBurn {
function burn(address account, uint amount) external;
function mint(address account, uint amount) external;
}
文件 8 的 17:IOracle.sol
pragma solidity ^0.6.12;
interface IOracle {
function setPrice(bytes32 _symbol, uint _price) external;
function getPrice(bytes32 _symbol) external view returns (uint);
}
文件 9 的 17:IStakingRewardsFactory.sol
pragma solidity ^0.6.12;
interface IStakingRewardsFactory {
function satelliteTVL() external view returns(uint);
}
文件 10 的 17:ITrusteeFeePool.sol
pragma solidity ^0.6.12;
interface ITrusteeFeePool {
function exit(address account) external;
function enter(address account) external;
function notifyReward(uint reward) external;
}
文件 11 的 17:ITunnel.sol
pragma solidity ^0.6.12;
interface ITunnel {
function pledge(address account, uint amount) external;
function redeem(address account, uint amount) external;
function issue(address account, uint amount) external;
function burn(address account, uint amount, string memory assetAddress) external;
function totalValuePledge() external view returns(uint);
function canIssueAmount() external view returns(uint);
function oTokenKey() external view returns(bytes32);
}
interface ITunnelV2 {
function pledge(address account, uint amount) external;
function redeem(address account, uint amount) external;
function issue(address account, uint amount) external;
function burn(address account, uint amount, string memory assetAddress) external;
function totalValuePledge() external view returns(uint);
function canIssueAmount() external view returns(uint);
}
interface ITunnelTVL {
function totalTVL() external view returns(uint);
}
文件 12 的 17:Ownable.sol
pragma solidity ^0.6.0;
import "../GSN/Context.sol";
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
文件 13 的 17:ParamBook.sol
pragma solidity ^0.6.12;
import "@openzeppelin/contracts/access/Ownable.sol";
contract ParamBook is Ownable {
mapping(bytes32 => uint256) public params;
mapping(bytes32 => mapping(bytes32 => uint256)) public params2;
function setParams(bytes32 name, uint256 value) public onlyOwner {
params[name] = value;
}
function setMultiParams(bytes32[] memory names, uint[] memory values) public onlyOwner {
require(names.length == values.length, "ParamBook::setMultiParams:param length not match");
for (uint i=0; i < names.length; i++ ) {
params[names[i]] = values[i];
}
}
function setParams2(
bytes32 name1,
bytes32 name2,
uint256 value
) public onlyOwner {
params2[name1][name2] = value;
}
function setMultiParams2(bytes32[] memory names1, bytes32[] memory names2, uint[] memory values) public onlyOwner {
require(names1.length == names2.length, "ParamBook::setMultiParams2:param length not match");
require(names1.length == values.length, "ParamBook::setMultiParams2:param length not match");
for(uint i=0; i < names1.length; i++) {
params2[names1[i]][names2[i]] = values[i];
}
}
}
文件 14 的 17:Pausable.sol
pragma solidity ^0.6.0;
import "../GSN/Context.sol";
contract Pausable is Context {
event Paused(address account);
event Unpaused(address account);
bool private _paused;
constructor () internal {
_paused = false;
}
function paused() public view returns (bool) {
return _paused;
}
modifier whenNotPaused() {
require(!_paused, "Pausable: paused");
_;
}
modifier whenPaused() {
require(_paused, "Pausable: not paused");
_;
}
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
}
文件 15 的 17:SafeDecimalMath.sol
pragma solidity ^0.6.8;
import "@openzeppelin/contracts/math/SafeMath.sol";
library SafeDecimalMath {
using SafeMath for uint;
uint8 public constant decimals = 18;
uint8 public constant highPrecisionDecimals = 27;
uint public constant UNIT = 10**uint(decimals);
uint public constant PRECISE_UNIT = 10**uint(highPrecisionDecimals);
uint private constant UNIT_TO_HIGH_PRECISION_CONVERSION_FACTOR = 10**uint(highPrecisionDecimals - decimals);
function unit() external pure returns (uint) {
return UNIT;
}
function preciseUnit() external pure returns (uint) {
return PRECISE_UNIT;
}
function multiplyDecimal(uint x, uint y) internal pure returns (uint) {
return x.mul(y) / UNIT;
}
function _multiplyDecimalRound(
uint x,
uint y,
uint precisionUnit
) private pure returns (uint) {
uint quotientTimesTen = x.mul(y) / (precisionUnit / 10);
if (quotientTimesTen % 10 >= 5) {
quotientTimesTen += 10;
}
return quotientTimesTen / 10;
}
function multiplyDecimalRoundPrecise(uint x, uint y) internal pure returns (uint) {
return _multiplyDecimalRound(x, y, PRECISE_UNIT);
}
function multiplyDecimalRound(uint x, uint y) internal pure returns (uint) {
return _multiplyDecimalRound(x, y, UNIT);
}
function divideDecimal(uint x, uint y) internal pure returns (uint) {
return x.mul(UNIT).div(y);
}
function _divideDecimalRound(
uint x,
uint y,
uint precisionUnit
) private pure returns (uint) {
uint resultTimesTen = x.mul(precisionUnit * 10).div(y);
if (resultTimesTen % 10 >= 5) {
resultTimesTen += 10;
}
return resultTimesTen / 10;
}
function divideDecimalRound(uint x, uint y) internal pure returns (uint) {
return _divideDecimalRound(x, y, UNIT);
}
function divideDecimalRoundPrecise(uint x, uint y) internal pure returns (uint) {
return _divideDecimalRound(x, y, PRECISE_UNIT);
}
function decimalToPreciseDecimal(uint i) internal pure returns (uint) {
return i.mul(UNIT_TO_HIGH_PRECISION_CONVERSION_FACTOR);
}
function preciseDecimalToDecimal(uint i) internal pure returns (uint) {
uint quotientTimesTen = i / (UNIT_TO_HIGH_PRECISION_CONVERSION_FACTOR / 10);
if (quotientTimesTen % 10 >= 5) {
quotientTimesTen += 10;
}
return quotientTimesTen / 10;
}
}
文件 16 的 17:SafeMath.sol
pragma solidity ^0.6.0;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
文件 17 的 17:TunnelV2.sol
pragma solidity ^0.6.12;
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/utils/Pausable.sol";
import "./interface/IAddressResolver.sol";
import "./interface/ITunnel.sol";
import "./ParamBook.sol";
import "./lib/SafeDecimalMath.sol";
import "./interface/IBoringDAO.sol";
import "./interface/IOracle.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "./interface/IFeePool.sol";
import "./interface/IStakingRewardsFactory.sol";
import "./interface/IMintBurn.sol";
import "./interface/ITrusteeFeePool.sol";
import "./interface/ILiquidate.sol";
contract TunnelV2 is Ownable, Pausable, ITunnelV2, ILiquidate {
using SafeMath for uint256;
using SafeDecimalMath for uint256;
IAddressResolver addrResolver;
bytes32 public constant BORINGDAO = "BoringDAO";
bytes32 public tunnelKey;
bytes32 public constant MINT_FEE = "mint_fee";
bytes32 public constant BURN_FEE = "burn_fee";
bytes32 public constant MINT_FEE_TRUSTEE = "mint_fee_trustee";
bytes32 public constant MINT_FEE_PLEDGER = "mint_fee_pledger";
bytes32 public constant MINT_FEE_DEV = "mint_fee_dev";
bytes32 public constant BURN_FEE_INSURANCE = "burn_fee_insurance";
bytes32 public constant BURN_FEE_PLEDGER = "burn_fee_pledger";
bytes32 public constant FEE_POOL = "FeePool";
bytes32 public constant INSURANCE_POOL = "InsurancePool";
bytes32 public constant DEV_ADDRESS = "DevUser";
bytes32 public constant ADDRESS_BOOK = "AddressBook";
bytes32 public constant ORACLE = "Oracle";
bytes32 public constant BOR = "BORING";
bytes32 public constant PLEDGE_RATE = "pledge_rate";
bytes32 public constant NETWORK_FEE = "network_fee";
bytes32 public constant PLEDGE_TOKEN = "ppToken";
bytes32 public constant OTOKEN = "oToken";
bytes32 public constant PARAM_BOOK = "ParamBook";
bytes32 public constant TRUSTEE_FEE_POOL = "TrusteeFeePool";
bytes32 public constant SATELLITE_POOL_FACTORY = "SatellitePoolFactory";
bytes32 public constant LIQUIDATION = "Liquidation";
mapping(address => uint) public borPledgeInfo;
uint256 public totalPledgeBOR;
uint256 public burnMiniLimit=1e15;
uint256 public redeemLockTxLimit=5;
struct PledgerInfo {
uint256 amount;
uint256 feeDebt;
}
struct LockAmount{
uint unlockTime;
uint amount;
}
mapping(address=>LockAmount[]) public lockInfo;
uint256 public lockDuration = 86400;
ITunnelTVL public oldTunnel;
constructor(
IAddressResolver _addrResolver,
bytes32 _tunnelKey,
ITunnelTVL _oldTunnel
) public {
addrResolver = _addrResolver;
tunnelKey = _tunnelKey;
oldTunnel = _oldTunnel;
}
function otokenMintBurn() internal view returns (IMintBurn) {
return IMintBurn(addrResolver.requireKKAddrs(tunnelKey, OTOKEN, "Tunnel::otokenMintBurn: oToken contract not exist in Tunnel"));
}
function otokenERC20() internal view returns (IERC20) {
return IERC20(addrResolver.requireKKAddrs(tunnelKey, OTOKEN, "Tunnel::otokenERC20: oToken contract not exist in Tunnel"));
}
function borERC20() internal view returns (IERC20) {
return IERC20(addrResolver.requireAndKey2Address(BOR, "borERC20::borERC20: BOR contract not exist in Tunnel"));
}
function boringDAO() internal view returns (IBoringDAO) {
return IBoringDAO(addrResolver.key2address(BORINGDAO));
}
function oracle() internal view returns (IOracle) {
return IOracle(addrResolver.key2address(ORACLE));
}
function ppTokenMintBurn() internal view returns (IMintBurn) {
return IMintBurn(addrResolver.requireKKAddrs(tunnelKey, PLEDGE_TOKEN, "Tunnel::ppTokenMintBurn::pptoken not exist"));
}
function ppTokenERC20() internal view returns (IERC20) {
return IERC20(addrResolver.requireKKAddrs(tunnelKey, PLEDGE_TOKEN, "Tunnel::ppTokenMintBurn::pptoken not exist"));
}
function feePool() internal view returns (IFeePool) {
return IFeePool(addrResolver.requireKKAddrs(tunnelKey, FEE_POOL, "Tunnel::feePool::feePool is not exist"));
}
function trusteeFeePool() internal view returns (ITrusteeFeePool) {
return ITrusteeFeePool(addrResolver.requireKKAddrs(tunnelKey, TRUSTEE_FEE_POOL, "Tunnel::trusteeFeePool is address(0)"));
}
function paramBook() internal view returns (ParamBook) {
return ParamBook(addrResolver.key2address(PARAM_BOOK));
}
function getRate(bytes32 name) internal view returns (uint256) {
return paramBook().params2(tunnelKey, name);
}
function satellitePoolFactory() internal view returns(IStakingRewardsFactory) {
return IStakingRewardsFactory(addrResolver.requireKKAddrs(tunnelKey, SATELLITE_POOL_FACTORY, "Tunnel::spf::spf is not exist"));
}
function totalValuePledge() public override view returns (uint256) {
uint256 borPrice = oracle().getPrice(BOR);
return totalPledgeBOR.multiplyDecimal(borPrice);
}
function userLockLength(address account) public view returns (uint) {
return lockInfo[account].length;
}
function userLockAmount() public view returns(uint256, uint256) {
uint lock;
uint unlock;
for (uint i=0; i<lockInfo[msg.sender].length; i++) {
if(block.timestamp >= lockInfo[msg.sender][i].unlockTime) {
unlock = unlock.add(lockInfo[msg.sender][i].amount);
} else {
lock = lock.add(lockInfo[msg.sender][i].amount);
}
}
return (lock, unlock);
}
function setLockDuration(uint duration) public onlyOwner {
lockDuration = duration;
}
function setRedeemLockTxLimit(uint limit) public onlyOwner {
redeemLockTxLimit = limit;
}
function setBurnMiniLimit(uint amount) public onlyOwner {
burnMiniLimit = amount;
}
function pledge(address account, uint256 amount)
external
override
onlyBoringDAO
{
borPledgeInfo[account] = borPledgeInfo[account].add(amount);
totalPledgeBOR = totalPledgeBOR.add(amount);
ppTokenMintBurn().mint(account, amount);
feePool().notifyPTokenAmount(account, amount);
emit PledgeSuccess(account, amount);
}
function redeem(address account, uint256 amount)
external
override
onlyBoringDAO
{
require(
ppTokenERC20().balanceOf(account) >= amount,
"Tunnel::redeem: not enough pledge provider token"
);
require(borPledgeInfo[account] >= amount, "Tunnel:redeem: Not enough bor amount");
require(lockInfo[account].length < redeemLockTxLimit, "Tunnel::redeem: A user can only redeem at most five redeem, try again after extraction");
borPledgeInfo[account] = borPledgeInfo[account].sub(amount);
lock(account, amount, block.timestamp.add(lockDuration));
ppTokenMintBurn().burn(account, amount);
feePool().withdraw(account, amount);
emit RedeemSuccess(account, amount);
}
function lock(address account, uint amount, uint unlockTime) internal {
lockInfo[account].push(LockAmount(unlockTime, amount));
}
function withdrawUnlock() public {
uint unlock;
uint i = 0;
while (i!=lockInfo[msg.sender].length) {
if (block.timestamp >= lockInfo[msg.sender][i].unlockTime) {
unlock = unlock.add(lockInfo[msg.sender][i].amount);
lockInfo[msg.sender][i] = lockInfo[msg.sender][lockInfo[msg.sender].length.sub(1)];
lockInfo[msg.sender].pop();
} else {
i++;
}
}
if (unlock > 0 ) {
totalPledgeBOR = totalPledgeBOR.sub(unlock);
borERC20().transfer(msg.sender, unlock);
emit WithdrawUnlockSuccess(
msg.sender,
unlock
);
}
}
function issue(address account, uint256 amount)
external
override
onlyBoringDAO
{
uint networkFee = paramBook().params2(tunnelKey, NETWORK_FEE);
uint256 mintFeeRation = getRate(MINT_FEE);
uint256 mintFeeAmount = amount.multiplyDecimal(mintFeeRation);
uint256 mintAmount = amount.sub(mintFeeAmount).sub(networkFee);
otokenMintBurn().mint(account, mintAmount);
uint256 mintFeeTrusteeRatio = getRate(MINT_FEE_TRUSTEE);
uint256 mintFeeTrusteeAmount = mintFeeAmount.multiplyDecimal(mintFeeTrusteeRatio).add(networkFee);
otokenMintBurn().mint(address(trusteeFeePool()), mintFeeTrusteeAmount);
trusteeFeePool().notifyReward(mintFeeTrusteeAmount);
uint256 mintFeePledgerRation = getRate(MINT_FEE_PLEDGER);
uint256 mintFeePledgerAmount = mintFeeAmount.multiplyDecimal(
mintFeePledgerRation
);
address feePoolAddress = address(feePool());
otokenMintBurn().mint(feePoolAddress, mintFeePledgerAmount);
feePool().notifyBTokenFeeAmount(mintFeePledgerAmount);
uint256 mintFeeDevRation = getRate(MINT_FEE_DEV);
uint256 mintFeeDevAmount = mintFeeAmount.multiplyDecimal(
mintFeeDevRation
);
address devAddress = addrResolver.key2address(DEV_ADDRESS);
otokenMintBurn().mint(devAddress, mintFeeDevAmount);
}
function burn(address account, uint256 amount, string memory assetAddress) external override onlyBoringDAO{
require(amount>=burnMiniLimit, "Tunnel::burn: the amount too small");
uint256 burnFeeAmountBToken = amount.multiplyDecimal(getRate(BURN_FEE));
uint burnFeeAmount = oracle().getPrice(tunnelKey).multiplyDecimal(burnFeeAmountBToken).divideDecimal(oracle().getPrice(BOR));
address insurancePoolAddress = addrResolver.requireKKAddrs(tunnelKey, INSURANCE_POOL, "insurancePool not exist");
uint256 burnFeeAmountInsurance = burnFeeAmount.multiplyDecimal(
getRate(BURN_FEE_INSURANCE)
);
uint256 burnFeeAmountPledger = burnFeeAmount.multiplyDecimal(
getRate(BURN_FEE_PLEDGER)
);
borERC20().transferFrom(
account,
insurancePoolAddress,
burnFeeAmountInsurance
);
borERC20().transferFrom(
account,
address(feePool()),
burnFeeAmountPledger
);
feePool().notifyBORFeeAmount(burnFeeAmountPledger);
otokenMintBurn().burn(account, amount);
emit BurnOToken(
account,
amount,
assetAddress
);
}
function oldTunnelTVL() public view returns(uint) {
return oldTunnel.totalTVL();
}
function totalTVL() public view returns(uint) {
uint256 borTVL = totalValuePledge();
uint satelliteTVL = satellitePoolFactory().satelliteTVL();
return borTVL.add(satelliteTVL).add(oldTunnelTVL());
}
function pledgeRatio() public view returns(uint) {
uint tvl = totalTVL();
uint btokenValue = otokenERC20().totalSupply().multiplyDecimal(oracle().getPrice(tunnelKey));
if (btokenValue == 0) {
return 0;
}
return tvl.divideDecimal(btokenValue);
}
function canIssueAmount() external override view returns (uint256) {
uint total = totalTVL();
uint256 pledgeRate = paramBook().params2(tunnelKey, PLEDGE_RATE);
uint256 canIssueValue = total.divideDecimal(pledgeRate);
uint256 tunnelKeyPrice = oracle().getPrice(tunnelKey);
return canIssueValue.divideDecimal(tunnelKeyPrice);
}
function liquidate(address account) public override onlyLiquidation {
borERC20().transfer(account, totalPledgeBOR);
}
function unpause() public returns (bool) {
if (totalPledgeBOR >= 0e18) {
_unpause();
}
return paused();
}
modifier onlyBoringDAO {
require(msg.sender == addrResolver.key2address(BORINGDAO));
_;
}
modifier onlyLiquidation {
require(msg.sender == addrResolver.requireKKAddrs(tunnelKey, LIQUIDATION, "Tunnel::liquidation contract no exist"));
_;
}
event BurnOToken(
address indexed account,
uint256 amount,
string assetAddress
);
event WithdrawUnlockSuccess(
address account,
uint amount
);
event PledgeSuccess(
address account,
uint amount
);
event RedeemSuccess(
address account,
uint amount
);
}
{
"compilationTarget": {
"contracts/TunnelV2.sol": "TunnelV2"
},
"evmVersion": "istanbul",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs",
"useLiteralContent": true
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": []
}
[{"inputs":[{"internalType":"contract IAddressResolver","name":"_addrResolver","type":"address"},{"internalType":"bytes32","name":"_tunnelKey","type":"bytes32"},{"internalType":"contract ITunnelTVL","name":"_oldTunnel","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"string","name":"assetAddress","type":"string"}],"name":"BurnOToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PledgeSuccess","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RedeemSuccess","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"WithdrawUnlockSuccess","type":"event"},{"inputs":[],"name":"ADDRESS_BOOK","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BORINGDAO","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BURN_FEE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BURN_FEE_INSURANCE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BURN_FEE_PLEDGER","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEV_ADDRESS","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FEE_POOL","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"INSURANCE_POOL","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"LIQUIDATION","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINT_FEE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINT_FEE_DEV","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINT_FEE_PLEDGER","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINT_FEE_TRUSTEE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NETWORK_FEE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ORACLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OTOKEN","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PARAM_BOOK","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PLEDGE_RATE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PLEDGE_TOKEN","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SATELLITE_POOL_FACTORY","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TRUSTEE_FEE_POOL","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"borPledgeInfo","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"string","name":"assetAddress","type":"string"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"burnMiniLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"canIssueAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"issue","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"liquidate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lockDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"lockInfo","outputs":[{"internalType":"uint256","name":"unlockTime","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"oldTunnel","outputs":[{"internalType":"contract ITunnelTVL","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"oldTunnelTVL","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"pledge","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"pledgeRatio","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"redeem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"redeemLockTxLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"setBurnMiniLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"duration","type":"uint256"}],"name":"setLockDuration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"limit","type":"uint256"}],"name":"setRedeemLockTxLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalPledgeBOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalTVL","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalValuePledge","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"tunnelKey","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"userLockAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"userLockLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawUnlock","outputs":[],"stateMutability":"nonpayable","type":"function"}]