Overview
Max Total Supply
13,271,200.479060821617793274 sDOLA
Holders
197 (0.00%)
Market
Price
$1.16 @ 0.000588 ETH (-1.55%)
Onchain Market Cap
-
Circulating Supply Market Cap
$12,364,979.00
Other Info
Token Contract (WITH 18 Decimals)
Balance
105.59886637566461871 sDOLAValue
$122.49 ( ~0.0621158852648934 Eth) [0.0008%]Loading...
Loading
Loading...
Loading
Loading...
Loading
| # | Exchange | Pair | Price | 24H Volume | % Volume |
|---|
Contract Name:
sDola
Compiler Version
v0.8.21+commit.d9974bed
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT License
pragma solidity 0.8.21;
import "lib/solmate/src/mixins/ERC4626.sol";
interface IDolaSavings {
function balanceOf(address user) external view returns (uint);
function stake(uint amount, address recipient) external;
function unstake(uint amount) external;
function claim(address to) external;
function claimable(address user) external view returns (uint);
function dbr() external view returns (address);
}
interface IERC20 {
function transfer(address, uint) external returns (bool);
function transferFrom(address, address, uint) external returns (bool);
function balanceOf(address) external view returns (uint);
}
/**
* @title sDola
* @dev Auto-compounding ERC4626 wrapper for DolaSacings utilizing xy=k auctions.
* WARNING: While this vault is safe to be used as collateral in lending markets, it should not be allowed as a borrowable asset.
* Any protocol in which sudden, large and atomic increases in the value of an asset may be a securit risk should not integrate this vault.
*/
contract sDola is ERC4626 {
uint constant MIN_BALANCE = 10**16; // 1 cent
uint public constant MIN_SHARES = 10**18;
uint public constant MAX_ASSETS = 10**32; // 100 trillion DOLA
IDolaSavings public immutable savings;
ERC20 public immutable dbr;
address public gov;
address public pendingGov;
address public operator;
uint public prevK;
uint public targetK;
uint public lastKUpdate;
mapping (uint => uint) public weeklyRevenue;
/**
* @dev Constructor for sDola contract.
* WARNING: MIN_SHARES will always be unwithdrawable from the vault. Deployer should deposit enough to mint MIN_SHARES to avoid causing user grief.
* @param _dola Address of the DOLA token.
* @param _savings Address of the DolaSavings contract.
* @param _gov Address of the governance.
* @param _K Initial value for the K variable used in calculations.
*/
constructor(
address _dola,
address _savings,
address _gov,
address _operator,
uint _K
) ERC4626(ERC20(_dola), "Staked Dola", "sDOLA") {
require(_K > 0, "_K must be positive");
savings = IDolaSavings(_savings);
dbr = ERC20(IDolaSavings(_savings).dbr());
gov = _gov;
operator = _operator;
targetK = _K;
asset.approve(_savings, type(uint).max);
}
modifier onlyGov() {
require(msg.sender == gov, "ONLY GOV");
_;
}
modifier onlyOperator() {
require(msg.sender == gov || msg.sender == operator, "ONLY OPERATOR");
_;
}
/**
* @dev Hook that is called after tokens are deposited into the contract.
* @param assets The amount of assets that were deposited.
*/
function afterDeposit(uint256 assets, uint256) internal override {
require(totalSupply >= MIN_SHARES, "Shares below MIN_SHARES");
savings.stake(assets, address(this));
}
/**
* @dev Hook that is called before tokens are withdrawn from the contract.
* @param assets The amount of assets to withdraw.
* @param shares The amount of shares to withdraw
*/
function beforeWithdraw(uint256 assets, uint256 shares) internal override {
require(totalAssets() >= assets + MIN_BALANCE, "Insufficient assets");
require(totalSupply - shares >= MIN_SHARES, "Shares below MIN_SHARES");
savings.unstake(assets);
}
/**
* @dev Calculates the total assets controlled by the contract.
* Weekly revenue is distributed linearly over the following week.
* @return The total assets in the contract.
*/
function totalAssets() public view override returns (uint) {
uint week = block.timestamp / 7 days;
uint timeElapsed = block.timestamp % 7 days;
uint remainingLastRevenue = weeklyRevenue[week - 1] * (7 days - timeElapsed) / 7 days;
uint actualAssets = savings.balanceOf(address(this)) - remainingLastRevenue - weeklyRevenue[week];
return actualAssets < MAX_ASSETS ? actualAssets : MAX_ASSETS;
}
/**
* @dev Returns the current value of K, which is a weighted average between prevK and targetK.
* @return The current value of K.
*/
function getK() public view returns (uint) {
uint duration = 7 days;
uint timeElapsed = block.timestamp - lastKUpdate;
if(timeElapsed > duration) {
return targetK;
}
uint targetWeight = timeElapsed;
uint prevWeight = duration - timeElapsed;
return (prevK * prevWeight + targetK * targetWeight) / duration;
}
/**
* @dev Calculates the DOLA reserve based on the current DBR reserve.
* @return The calculated DOLA reserve.
*/
function getDolaReserve() public view returns (uint) {
return getK() / getDbrReserve();
}
/**
* @dev Calculates the DOLA reserve for a given DBR reserve.
* @param dbrReserve The DBR reserve value.
* @return The calculated DOLA reserve.
*/
function getDolaReserve(uint dbrReserve) public view returns (uint) {
return getK() / dbrReserve;
}
/**
* @dev Returns the current DBR reserve as the sum of dbr balance and claimable dbr
* @return The current DBR reserve.
*/
function getDbrReserve() public view returns (uint) {
return dbr.balanceOf(address(this)) + savings.claimable(address(this));
}
/**
* @dev Sets a new target K value.
* @param _K The new target K value.
*/
function setTargetK(uint _K) external onlyOperator {
require(_K > getDbrReserve(), "K must be larger than dbr reserve");
prevK = getK();
targetK = _K;
lastKUpdate = block.timestamp;
emit SetTargetK(_K);
}
/**
* @dev Allows users to buy DBR with DOLA.
* WARNING: Never expose this directly to a UI as it's likely to cause a loss unless a transaction is executed immediately.
* Instead use the sDolaHelper function or custom smart contract code.
* @param exactDolaIn The exact amount of DOLA to spend.
* @param exactDbrOut The exact amount of DBR to receive.
* @param to The address that will receive the DBR.
*/
function buyDBR(uint exactDolaIn, uint exactDbrOut, address to) external {
require(to != address(0), "Zero address");
savings.claim(address(this));
uint k = getK();
uint dbrBalance = dbr.balanceOf(address(this));
uint dbrReserve = dbrBalance - exactDbrOut;
uint dolaReserve = k / dbrBalance + exactDolaIn;
require(dolaReserve * dbrReserve >= k, "Invariant");
asset.transferFrom(msg.sender, address(this), exactDolaIn);
savings.stake(exactDolaIn, address(this));
weeklyRevenue[block.timestamp / 7 days] += exactDolaIn;
dbr.transfer(to, exactDbrOut);
emit Buy(msg.sender, to, exactDolaIn, exactDbrOut);
}
/**
* @dev Sets a new pending governance address.
* @param _gov The address of the new pending governance.
*/
function setPendingGov(address _gov) external onlyGov {
pendingGov = _gov;
}
/**
* @dev Sets a new operator address.
* @param _operator New operator address.
*/
function setOperator(address _operator) external onlyGov {
operator = _operator;
}
/**
* @dev Allows the pending governance to accept its role.
*/
function acceptGov() external {
require(msg.sender == pendingGov, "ONLY PENDINGGOV");
gov = pendingGov;
pendingGov = address(0);
}
/**
* @dev Re-approves the DOLA token to be spent by the DolaSavings contract.
*/
function reapprove() external {
asset.approve(address(savings), type(uint).max);
}
/**
* @dev Allows governance to sweep any ERC20 token from the contract.
* @dev Excludes the ability to sweep DBR tokens.
* @param token The address of the ERC20 token to sweep.
* @param amount The amount of tokens to sweep.
* @param to The recipient address of the swept tokens.
*/
function sweep(address token, uint amount, address to) public onlyGov {
require(address(dbr) != token, "Not authorized");
IERC20(token).transfer(to, amount);
}
event Buy(address indexed caller, address indexed to, uint exactDolaIn, uint exactDbrOut);
event SetTargetK(uint newTargetK);
}// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;
import {ERC20} from "../tokens/ERC20.sol";
import {SafeTransferLib} from "../utils/SafeTransferLib.sol";
import {FixedPointMathLib} from "../utils/FixedPointMathLib.sol";
/// @notice Minimal ERC4626 tokenized Vault implementation.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/mixins/ERC4626.sol)
abstract contract ERC4626 is ERC20 {
using SafeTransferLib for ERC20;
using FixedPointMathLib for uint256;
/*//////////////////////////////////////////////////////////////
EVENTS
//////////////////////////////////////////////////////////////*/
event Deposit(address indexed caller, address indexed owner, uint256 assets, uint256 shares);
event Withdraw(
address indexed caller,
address indexed receiver,
address indexed owner,
uint256 assets,
uint256 shares
);
/*//////////////////////////////////////////////////////////////
IMMUTABLES
//////////////////////////////////////////////////////////////*/
ERC20 public immutable asset;
constructor(
ERC20 _asset,
string memory _name,
string memory _symbol
) ERC20(_name, _symbol, _asset.decimals()) {
asset = _asset;
}
/*//////////////////////////////////////////////////////////////
DEPOSIT/WITHDRAWAL LOGIC
//////////////////////////////////////////////////////////////*/
function deposit(uint256 assets, address receiver) public virtual returns (uint256 shares) {
// Check for rounding error since we round down in previewDeposit.
require((shares = previewDeposit(assets)) != 0, "ZERO_SHARES");
// Need to transfer before minting or ERC777s could reenter.
asset.safeTransferFrom(msg.sender, address(this), assets);
_mint(receiver, shares);
emit Deposit(msg.sender, receiver, assets, shares);
afterDeposit(assets, shares);
}
function mint(uint256 shares, address receiver) public virtual returns (uint256 assets) {
assets = previewMint(shares); // No need to check for rounding error, previewMint rounds up.
// Need to transfer before minting or ERC777s could reenter.
asset.safeTransferFrom(msg.sender, address(this), assets);
_mint(receiver, shares);
emit Deposit(msg.sender, receiver, assets, shares);
afterDeposit(assets, shares);
}
function withdraw(
uint256 assets,
address receiver,
address owner
) public virtual returns (uint256 shares) {
shares = previewWithdraw(assets); // No need to check for rounding error, previewWithdraw rounds up.
if (msg.sender != owner) {
uint256 allowed = allowance[owner][msg.sender]; // Saves gas for limited approvals.
if (allowed != type(uint256).max) allowance[owner][msg.sender] = allowed - shares;
}
beforeWithdraw(assets, shares);
_burn(owner, shares);
emit Withdraw(msg.sender, receiver, owner, assets, shares);
asset.safeTransfer(receiver, assets);
}
function redeem(
uint256 shares,
address receiver,
address owner
) public virtual returns (uint256 assets) {
if (msg.sender != owner) {
uint256 allowed = allowance[owner][msg.sender]; // Saves gas for limited approvals.
if (allowed != type(uint256).max) allowance[owner][msg.sender] = allowed - shares;
}
// Check for rounding error since we round down in previewRedeem.
require((assets = previewRedeem(shares)) != 0, "ZERO_ASSETS");
beforeWithdraw(assets, shares);
_burn(owner, shares);
emit Withdraw(msg.sender, receiver, owner, assets, shares);
asset.safeTransfer(receiver, assets);
}
/*//////////////////////////////////////////////////////////////
ACCOUNTING LOGIC
//////////////////////////////////////////////////////////////*/
function totalAssets() public view virtual returns (uint256);
function convertToShares(uint256 assets) public view virtual returns (uint256) {
uint256 supply = totalSupply; // Saves an extra SLOAD if totalSupply is non-zero.
return supply == 0 ? assets : assets.mulDivDown(supply, totalAssets());
}
function convertToAssets(uint256 shares) public view virtual returns (uint256) {
uint256 supply = totalSupply; // Saves an extra SLOAD if totalSupply is non-zero.
return supply == 0 ? shares : shares.mulDivDown(totalAssets(), supply);
}
function previewDeposit(uint256 assets) public view virtual returns (uint256) {
return convertToShares(assets);
}
function previewMint(uint256 shares) public view virtual returns (uint256) {
uint256 supply = totalSupply; // Saves an extra SLOAD if totalSupply is non-zero.
return supply == 0 ? shares : shares.mulDivUp(totalAssets(), supply);
}
function previewWithdraw(uint256 assets) public view virtual returns (uint256) {
uint256 supply = totalSupply; // Saves an extra SLOAD if totalSupply is non-zero.
return supply == 0 ? assets : assets.mulDivUp(supply, totalAssets());
}
function previewRedeem(uint256 shares) public view virtual returns (uint256) {
return convertToAssets(shares);
}
/*//////////////////////////////////////////////////////////////
DEPOSIT/WITHDRAWAL LIMIT LOGIC
//////////////////////////////////////////////////////////////*/
function maxDeposit(address) public view virtual returns (uint256) {
return type(uint256).max;
}
function maxMint(address) public view virtual returns (uint256) {
return type(uint256).max;
}
function maxWithdraw(address owner) public view virtual returns (uint256) {
return convertToAssets(balanceOf[owner]);
}
function maxRedeem(address owner) public view virtual returns (uint256) {
return balanceOf[owner];
}
/*//////////////////////////////////////////////////////////////
INTERNAL HOOKS LOGIC
//////////////////////////////////////////////////////////////*/
function beforeWithdraw(uint256 assets, uint256 shares) internal virtual {}
function afterDeposit(uint256 assets, uint256 shares) internal virtual {}
}// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;
/// @notice Modern and gas efficient ERC20 + EIP-2612 implementation.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/ERC20.sol)
/// @author Modified from Uniswap (https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/UniswapV2ERC20.sol)
/// @dev Do not manually set balances without updating totalSupply, as the sum of all user balances must not exceed it.
abstract contract ERC20 {
/*//////////////////////////////////////////////////////////////
EVENTS
//////////////////////////////////////////////////////////////*/
event Transfer(address indexed from, address indexed to, uint256 amount);
event Approval(address indexed owner, address indexed spender, uint256 amount);
/*//////////////////////////////////////////////////////////////
METADATA STORAGE
//////////////////////////////////////////////////////////////*/
string public name;
string public symbol;
uint8 public immutable decimals;
/*//////////////////////////////////////////////////////////////
ERC20 STORAGE
//////////////////////////////////////////////////////////////*/
uint256 public totalSupply;
mapping(address => uint256) public balanceOf;
mapping(address => mapping(address => uint256)) public allowance;
/*//////////////////////////////////////////////////////////////
EIP-2612 STORAGE
//////////////////////////////////////////////////////////////*/
uint256 internal immutable INITIAL_CHAIN_ID;
bytes32 internal immutable INITIAL_DOMAIN_SEPARATOR;
mapping(address => uint256) public nonces;
/*//////////////////////////////////////////////////////////////
CONSTRUCTOR
//////////////////////////////////////////////////////////////*/
constructor(
string memory _name,
string memory _symbol,
uint8 _decimals
) {
name = _name;
symbol = _symbol;
decimals = _decimals;
INITIAL_CHAIN_ID = block.chainid;
INITIAL_DOMAIN_SEPARATOR = computeDomainSeparator();
}
/*//////////////////////////////////////////////////////////////
ERC20 LOGIC
//////////////////////////////////////////////////////////////*/
function approve(address spender, uint256 amount) public virtual returns (bool) {
allowance[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
function transfer(address to, uint256 amount) public virtual returns (bool) {
balanceOf[msg.sender] -= amount;
// Cannot overflow because the sum of all user
// balances can't exceed the max uint256 value.
unchecked {
balanceOf[to] += amount;
}
emit Transfer(msg.sender, to, amount);
return true;
}
function transferFrom(
address from,
address to,
uint256 amount
) public virtual returns (bool) {
uint256 allowed = allowance[from][msg.sender]; // Saves gas for limited approvals.
if (allowed != type(uint256).max) allowance[from][msg.sender] = allowed - amount;
balanceOf[from] -= amount;
// Cannot overflow because the sum of all user
// balances can't exceed the max uint256 value.
unchecked {
balanceOf[to] += amount;
}
emit Transfer(from, to, amount);
return true;
}
/*//////////////////////////////////////////////////////////////
EIP-2612 LOGIC
//////////////////////////////////////////////////////////////*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) public virtual {
require(deadline >= block.timestamp, "PERMIT_DEADLINE_EXPIRED");
// Unchecked because the only math done is incrementing
// the owner's nonce which cannot realistically overflow.
unchecked {
address recoveredAddress = ecrecover(
keccak256(
abi.encodePacked(
"\x19\x01",
DOMAIN_SEPARATOR(),
keccak256(
abi.encode(
keccak256(
"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"
),
owner,
spender,
value,
nonces[owner]++,
deadline
)
)
)
),
v,
r,
s
);
require(recoveredAddress != address(0) && recoveredAddress == owner, "INVALID_SIGNER");
allowance[recoveredAddress][spender] = value;
}
emit Approval(owner, spender, value);
}
function DOMAIN_SEPARATOR() public view virtual returns (bytes32) {
return block.chainid == INITIAL_CHAIN_ID ? INITIAL_DOMAIN_SEPARATOR : computeDomainSeparator();
}
function computeDomainSeparator() internal view virtual returns (bytes32) {
return
keccak256(
abi.encode(
keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"),
keccak256(bytes(name)),
keccak256("1"),
block.chainid,
address(this)
)
);
}
/*//////////////////////////////////////////////////////////////
INTERNAL MINT/BURN LOGIC
//////////////////////////////////////////////////////////////*/
function _mint(address to, uint256 amount) internal virtual {
totalSupply += amount;
// Cannot overflow because the sum of all user
// balances can't exceed the max uint256 value.
unchecked {
balanceOf[to] += amount;
}
emit Transfer(address(0), to, amount);
}
function _burn(address from, uint256 amount) internal virtual {
balanceOf[from] -= amount;
// Cannot underflow because a user's balance
// will never be larger than the total supply.
unchecked {
totalSupply -= amount;
}
emit Transfer(from, address(0), amount);
}
}// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;
import {ERC20} from "../tokens/ERC20.sol";
/// @notice Safe ETH and ERC20 transfer library that gracefully handles missing return values.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/SafeTransferLib.sol)
/// @dev Use with caution! Some functions in this library knowingly create dirty bits at the destination of the free memory pointer.
/// @dev Note that none of the functions in this library check that a token has code at all! That responsibility is delegated to the caller.
library SafeTransferLib {
/*//////////////////////////////////////////////////////////////
ETH OPERATIONS
//////////////////////////////////////////////////////////////*/
function safeTransferETH(address to, uint256 amount) internal {
bool success;
/// @solidity memory-safe-assembly
assembly {
// Transfer the ETH and store if it succeeded or not.
success := call(gas(), to, amount, 0, 0, 0, 0)
}
require(success, "ETH_TRANSFER_FAILED");
}
/*//////////////////////////////////////////////////////////////
ERC20 OPERATIONS
//////////////////////////////////////////////////////////////*/
function safeTransferFrom(
ERC20 token,
address from,
address to,
uint256 amount
) internal {
bool success;
/// @solidity memory-safe-assembly
assembly {
// Get a pointer to some free memory.
let freeMemoryPointer := mload(0x40)
// Write the abi-encoded calldata into memory, beginning with the function selector.
mstore(freeMemoryPointer, 0x23b872dd00000000000000000000000000000000000000000000000000000000)
mstore(add(freeMemoryPointer, 4), and(from, 0xffffffffffffffffffffffffffffffffffffffff)) // Append and mask the "from" argument.
mstore(add(freeMemoryPointer, 36), and(to, 0xffffffffffffffffffffffffffffffffffffffff)) // Append and mask the "to" argument.
mstore(add(freeMemoryPointer, 68), amount) // Append the "amount" argument. Masking not required as it's a full 32 byte type.
success := and(
// Set success to whether the call reverted, if not we check it either
// returned exactly 1 (can't just be non-zero data), or had no return data.
or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),
// We use 100 because the length of our calldata totals up like so: 4 + 32 * 3.
// We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.
// Counterintuitively, this call must be positioned second to the or() call in the
// surrounding and() call or else returndatasize() will be zero during the computation.
call(gas(), token, 0, freeMemoryPointer, 100, 0, 32)
)
}
require(success, "TRANSFER_FROM_FAILED");
}
function safeTransfer(
ERC20 token,
address to,
uint256 amount
) internal {
bool success;
/// @solidity memory-safe-assembly
assembly {
// Get a pointer to some free memory.
let freeMemoryPointer := mload(0x40)
// Write the abi-encoded calldata into memory, beginning with the function selector.
mstore(freeMemoryPointer, 0xa9059cbb00000000000000000000000000000000000000000000000000000000)
mstore(add(freeMemoryPointer, 4), and(to, 0xffffffffffffffffffffffffffffffffffffffff)) // Append and mask the "to" argument.
mstore(add(freeMemoryPointer, 36), amount) // Append the "amount" argument. Masking not required as it's a full 32 byte type.
success := and(
// Set success to whether the call reverted, if not we check it either
// returned exactly 1 (can't just be non-zero data), or had no return data.
or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),
// We use 68 because the length of our calldata totals up like so: 4 + 32 * 2.
// We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.
// Counterintuitively, this call must be positioned second to the or() call in the
// surrounding and() call or else returndatasize() will be zero during the computation.
call(gas(), token, 0, freeMemoryPointer, 68, 0, 32)
)
}
require(success, "TRANSFER_FAILED");
}
function safeApprove(
ERC20 token,
address to,
uint256 amount
) internal {
bool success;
/// @solidity memory-safe-assembly
assembly {
// Get a pointer to some free memory.
let freeMemoryPointer := mload(0x40)
// Write the abi-encoded calldata into memory, beginning with the function selector.
mstore(freeMemoryPointer, 0x095ea7b300000000000000000000000000000000000000000000000000000000)
mstore(add(freeMemoryPointer, 4), and(to, 0xffffffffffffffffffffffffffffffffffffffff)) // Append and mask the "to" argument.
mstore(add(freeMemoryPointer, 36), amount) // Append the "amount" argument. Masking not required as it's a full 32 byte type.
success := and(
// Set success to whether the call reverted, if not we check it either
// returned exactly 1 (can't just be non-zero data), or had no return data.
or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),
// We use 68 because the length of our calldata totals up like so: 4 + 32 * 2.
// We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.
// Counterintuitively, this call must be positioned second to the or() call in the
// surrounding and() call or else returndatasize() will be zero during the computation.
call(gas(), token, 0, freeMemoryPointer, 68, 0, 32)
)
}
require(success, "APPROVE_FAILED");
}
}// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;
/// @notice Arithmetic library with operations for fixed-point numbers.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/FixedPointMathLib.sol)
/// @author Inspired by USM (https://github.com/usmfum/USM/blob/master/contracts/WadMath.sol)
library FixedPointMathLib {
/*//////////////////////////////////////////////////////////////
SIMPLIFIED FIXED POINT OPERATIONS
//////////////////////////////////////////////////////////////*/
uint256 internal constant MAX_UINT256 = 2**256 - 1;
uint256 internal constant WAD = 1e18; // The scalar of ETH and most ERC20s.
function mulWadDown(uint256 x, uint256 y) internal pure returns (uint256) {
return mulDivDown(x, y, WAD); // Equivalent to (x * y) / WAD rounded down.
}
function mulWadUp(uint256 x, uint256 y) internal pure returns (uint256) {
return mulDivUp(x, y, WAD); // Equivalent to (x * y) / WAD rounded up.
}
function divWadDown(uint256 x, uint256 y) internal pure returns (uint256) {
return mulDivDown(x, WAD, y); // Equivalent to (x * WAD) / y rounded down.
}
function divWadUp(uint256 x, uint256 y) internal pure returns (uint256) {
return mulDivUp(x, WAD, y); // Equivalent to (x * WAD) / y rounded up.
}
/*//////////////////////////////////////////////////////////////
LOW LEVEL FIXED POINT OPERATIONS
//////////////////////////////////////////////////////////////*/
function mulDivDown(
uint256 x,
uint256 y,
uint256 denominator
) internal pure returns (uint256 z) {
/// @solidity memory-safe-assembly
assembly {
// Equivalent to require(denominator != 0 && (y == 0 || x <= type(uint256).max / y))
if iszero(mul(denominator, iszero(mul(y, gt(x, div(MAX_UINT256, y)))))) {
revert(0, 0)
}
// Divide x * y by the denominator.
z := div(mul(x, y), denominator)
}
}
function mulDivUp(
uint256 x,
uint256 y,
uint256 denominator
) internal pure returns (uint256 z) {
/// @solidity memory-safe-assembly
assembly {
// Equivalent to require(denominator != 0 && (y == 0 || x <= type(uint256).max / y))
if iszero(mul(denominator, iszero(mul(y, gt(x, div(MAX_UINT256, y)))))) {
revert(0, 0)
}
// If x * y modulo the denominator is strictly greater than 0,
// 1 is added to round up the division of x * y by the denominator.
z := add(gt(mod(mul(x, y), denominator), 0), div(mul(x, y), denominator))
}
}
function rpow(
uint256 x,
uint256 n,
uint256 scalar
) internal pure returns (uint256 z) {
/// @solidity memory-safe-assembly
assembly {
switch x
case 0 {
switch n
case 0 {
// 0 ** 0 = 1
z := scalar
}
default {
// 0 ** n = 0
z := 0
}
}
default {
switch mod(n, 2)
case 0 {
// If n is even, store scalar in z for now.
z := scalar
}
default {
// If n is odd, store x in z for now.
z := x
}
// Shifting right by 1 is like dividing by 2.
let half := shr(1, scalar)
for {
// Shift n right by 1 before looping to halve it.
n := shr(1, n)
} n {
// Shift n right by 1 each iteration to halve it.
n := shr(1, n)
} {
// Revert immediately if x ** 2 would overflow.
// Equivalent to iszero(eq(div(xx, x), x)) here.
if shr(128, x) {
revert(0, 0)
}
// Store x squared.
let xx := mul(x, x)
// Round to the nearest number.
let xxRound := add(xx, half)
// Revert if xx + half overflowed.
if lt(xxRound, xx) {
revert(0, 0)
}
// Set x to scaled xxRound.
x := div(xxRound, scalar)
// If n is even:
if mod(n, 2) {
// Compute z * x.
let zx := mul(z, x)
// If z * x overflowed:
if iszero(eq(div(zx, x), z)) {
// Revert if x is non-zero.
if iszero(iszero(x)) {
revert(0, 0)
}
}
// Round to the nearest number.
let zxRound := add(zx, half)
// Revert if zx + half overflowed.
if lt(zxRound, zx) {
revert(0, 0)
}
// Return properly scaled zxRound.
z := div(zxRound, scalar)
}
}
}
}
}
/*//////////////////////////////////////////////////////////////
GENERAL NUMBER UTILITIES
//////////////////////////////////////////////////////////////*/
function sqrt(uint256 x) internal pure returns (uint256 z) {
/// @solidity memory-safe-assembly
assembly {
let y := x // We start y at x, which will help us make our initial estimate.
z := 181 // The "correct" value is 1, but this saves a multiplication later.
// This segment is to get a reasonable initial estimate for the Babylonian method. With a bad
// start, the correct # of bits increases ~linearly each iteration instead of ~quadratically.
// We check y >= 2^(k + 8) but shift right by k bits
// each branch to ensure that if x >= 256, then y >= 256.
if iszero(lt(y, 0x10000000000000000000000000000000000)) {
y := shr(128, y)
z := shl(64, z)
}
if iszero(lt(y, 0x1000000000000000000)) {
y := shr(64, y)
z := shl(32, z)
}
if iszero(lt(y, 0x10000000000)) {
y := shr(32, y)
z := shl(16, z)
}
if iszero(lt(y, 0x1000000)) {
y := shr(16, y)
z := shl(8, z)
}
// Goal was to get z*z*y within a small factor of x. More iterations could
// get y in a tighter range. Currently, we will have y in [256, 256*2^16).
// We ensured y >= 256 so that the relative difference between y and y+1 is small.
// That's not possible if x < 256 but we can just verify those cases exhaustively.
// Now, z*z*y <= x < z*z*(y+1), and y <= 2^(16+8), and either y >= 256, or x < 256.
// Correctness can be checked exhaustively for x < 256, so we assume y >= 256.
// Then z*sqrt(y) is within sqrt(257)/sqrt(256) of sqrt(x), or about 20bps.
// For s in the range [1/256, 256], the estimate f(s) = (181/1024) * (s+1) is in the range
// (1/2.84 * sqrt(s), 2.84 * sqrt(s)), with largest error when s = 1 and when s = 256 or 1/256.
// Since y is in [256, 256*2^16), let a = y/65536, so that a is in [1/256, 256). Then we can estimate
// sqrt(y) using sqrt(65536) * 181/1024 * (a + 1) = 181/4 * (y + 65536)/65536 = 181 * (y + 65536)/2^18.
// There is no overflow risk here since y < 2^136 after the first branch above.
z := shr(18, mul(z, add(y, 65536))) // A mul() is saved from starting z at 181.
// Given the worst case multiplicative error of 2.84 above, 7 iterations should be enough.
z := shr(1, add(z, div(x, z)))
z := shr(1, add(z, div(x, z)))
z := shr(1, add(z, div(x, z)))
z := shr(1, add(z, div(x, z)))
z := shr(1, add(z, div(x, z)))
z := shr(1, add(z, div(x, z)))
z := shr(1, add(z, div(x, z)))
// If x+1 is a perfect square, the Babylonian method cycles between
// floor(sqrt(x)) and ceil(sqrt(x)). This statement ensures we return floor.
// See: https://en.wikipedia.org/wiki/Integer_square_root#Using_only_integer_division
// Since the ceil is rare, we save gas on the assignment and repeat division in the rare case.
// If you don't care whether the floor or ceil square root is returned, you can remove this statement.
z := sub(z, lt(div(x, z), z))
}
}
function unsafeMod(uint256 x, uint256 y) internal pure returns (uint256 z) {
/// @solidity memory-safe-assembly
assembly {
// Mod x by y. Note this will return
// 0 instead of reverting if y is zero.
z := mod(x, y)
}
}
function unsafeDiv(uint256 x, uint256 y) internal pure returns (uint256 r) {
/// @solidity memory-safe-assembly
assembly {
// Divide x by y. Note this will return
// 0 instead of reverting if y is zero.
r := div(x, y)
}
}
function unsafeDivUp(uint256 x, uint256 y) internal pure returns (uint256 z) {
/// @solidity memory-safe-assembly
assembly {
// Add 1 to x * y if x % y > 0. Note this will
// return 0 instead of reverting if y is zero.
z := add(gt(mod(x, y), 0), div(x, y))
}
}
}{
"remappings": [
"ds-test/=lib/solmate/lib/ds-test/src/",
"forge-std/=lib/forge-std/src/",
"solmate/=lib/solmate/src/"
],
"optimizer": {
"enabled": true,
"runs": 200
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "ipfs",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "paris",
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_dola","type":"address"},{"internalType":"address","name":"_savings","type":"address"},{"internalType":"address","name":"_gov","type":"address"},{"internalType":"address","name":"_operator","type":"address"},{"internalType":"uint256","name":"_K","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"exactDolaIn","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"exactDbrOut","type":"uint256"}],"name":"Buy","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"assets","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newTargetK","type":"uint256"}],"name":"SetTargetK","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"assets","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_ASSETS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MIN_SHARES","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"acceptGov","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"asset","outputs":[{"internalType":"contract ERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"exactDolaIn","type":"uint256"},{"internalType":"uint256","name":"exactDbrOut","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"name":"buyDBR","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"name":"convertToAssets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"}],"name":"convertToShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"dbr","outputs":[{"internalType":"contract ERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"}],"name":"deposit","outputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getDbrReserve","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDolaReserve","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"dbrReserve","type":"uint256"}],"name":"getDolaReserve","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getK","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gov","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastKUpdate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"maxDeposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"maxMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"maxRedeem","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"maxWithdraw","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"}],"name":"mint","outputs":[{"internalType":"uint256","name":"assets","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"operator","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingGov","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"prevK","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"}],"name":"previewDeposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"name":"previewMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"name":"previewRedeem","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"}],"name":"previewWithdraw","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"reapprove","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"owner","type":"address"}],"name":"redeem","outputs":[{"internalType":"uint256","name":"assets","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"savings","outputs":[{"internalType":"contract IDolaSavings","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_operator","type":"address"}],"name":"setOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_gov","type":"address"}],"name":"setPendingGov","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_K","type":"uint256"}],"name":"setTargetK","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"name":"sweep","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"targetK","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalAssets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"weeklyRevenue","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"owner","type":"address"}],"name":"withdraw","outputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
6101406040523480156200001257600080fd5b5060405162002b4e38038062002b4e83398101604081905262000035916200035b565b846040518060400160405280600b81526020016a5374616b656420446f6c6160a81b8152506040518060400160405280600581526020016473444f4c4160d81b8152508181846001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015620000b9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000df9190620003c2565b6000620000ed848262000493565b506001620000fc838262000493565b5060ff81166080524660a05262000112620002a2565b60c0525050506001600160a01b0390921660e0525050806200017a5760405162461bcd60e51b815260206004820152601360248201527f5f4b206d75737420626520706f73697469766500000000000000000000000000604482015260640160405180910390fd5b6001600160a01b0384166101008190526040805163c7ed69cd60e01b8152905163c7ed69cd916004808201926020929091908290030181865afa158015620001c6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001ec91906200055f565b6001600160a01b0390811661012052600680546001600160a01b03199081168684161790915560088054909116848316179055600a82905560e05160405163095ea7b360e01b81528683166004820152600019602482015291169063095ea7b3906044016020604051808303816000875af115801562000270573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200029691906200057d565b5050505050506200061f565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6000604051620002d69190620005a1565b6040805191829003822060208301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b80516001600160a01b03811681146200035657600080fd5b919050565b600080600080600060a086880312156200037457600080fd5b6200037f866200033e565b94506200038f602087016200033e565b93506200039f604087016200033e565b9250620003af606087016200033e565b9150608086015190509295509295909350565b600060208284031215620003d557600080fd5b815160ff81168114620003e757600080fd5b9392505050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200041957607f821691505b6020821081036200043a57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200048e57600081815260208120601f850160051c81016020861015620004695750805b601f850160051c820191505b818110156200048a5782815560010162000475565b5050505b505050565b81516001600160401b03811115620004af57620004af620003ee565b620004c781620004c0845462000404565b8462000440565b602080601f831160018114620004ff5760008415620004e65750858301515b600019600386901b1c1916600185901b1785556200048a565b600085815260208120601f198616915b8281101562000530578886015182559484019460019091019084016200050f565b50858210156200054f5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000602082840312156200057257600080fd5b620003e7826200033e565b6000602082840312156200059057600080fd5b81518015158114620003e757600080fd5b6000808354620005b18162000404565b60018281168015620005cc5760018114620005e25762000613565b60ff198416875282151583028701945062000613565b8760005260208060002060005b858110156200060a5781548a820152908401908201620005ef565b50505082870194505b50929695505050505050565b60805160a05160c05160e0516101005161012051612468620006e6600039600081816105c801528181610dfb01528181611072015281816112bf01526119a90152600081816105ef0152818161078401528181610d7301528181610fe1015281816111ff015281816118d301528181611d8e0152611ec901526000818161042701528181610b5d01528181610e920152818161116d015281816114cf0152818161161b015261190301526000610ad301526000610aa3015260006103e601526124686000f3fe608060405234801561001057600080fd5b50600436106102d65760003560e01c80637ecebe0011610182578063c6e6f592116100e9578063d818f23a116100a2578063dd62ed3e1161007c578063dd62ed3e1461069b578063ee39e7a0146106c6578063ef8b30f7146106ce578063efdf0bb0146106e157600080fd5b8063d818f23a14610657578063d905777e1461065f578063dc2c256f1461068857600080fd5b8063c6e6f592146105b0578063c7ed69cd146105c3578063c86d6ae4146105ea578063ce96cb7714610611578063d04f688914610624578063d505accf1461064457600080fd5b8063b23adea61161013b578063b23adea614610551578063b3ab15fb14610564578063b3d7f6b914610577578063b460af941461058a578063ba0876521461059d578063c63d75b61461044957600080fd5b80637ecebe00146104f257806387a64c011461051257806394bf804d1461051a57806395d89b411461052d578063a08b06db14610535578063a9059cbb1461053e57600080fd5b806329a32d6611610241578063570ca735116101fa5780637153a20d116101d45780637153a20d146104b757806376b1d08f146104cc578063781f56de146104e15780637bc6729b146104ea57600080fd5b8063570ca735146104715780636e553f651461048457806370a082311461049757600080fd5b806329a32d66146103ce578063313ce567146103e15780633644e5151461041a57806338d52e0f14610422578063402d267d146104495780634cdad5061461045e57600080fd5b806318160ddd1161029357806318160ddd1461037f5780631cd1cf64146103885780631fcd30801461039157806323b872dd146103a057806325240810146103b357806325adc82d146103c657600080fd5b806301e1d114146102db57806306fdde03146102f657806307a2d13a1461030b578063095ea7b31461031e5780630a28a4771461034157806312d43a5114610354575b600080fd5b6102e36106f4565b6040519081526020015b60405180910390f35b6102fe610841565b6040516102ed9190611fe3565b6102e3610319366004612031565b6108cf565b61033161032c366004612066565b6108fc565b60405190151581526020016102ed565b6102e361034f366004612031565b610969565b600654610367906001600160a01b031681565b6040516001600160a01b0390911681526020016102ed565b6102e360025481565b6102e3600a5481565b6102e3670de0b6b3a764000081565b6103316103ae366004612090565b610989565b600754610367906001600160a01b031681565b6102e3610a69565b6102e36103dc366004612031565b610a8a565b6104087f000000000000000000000000000000000000000000000000000000000000000081565b60405160ff90911681526020016102ed565b6102e3610a9f565b6103677f000000000000000000000000000000000000000000000000000000000000000081565b6102e36104573660046120cc565b5060001990565b6102e361046c366004612031565b610af5565b600854610367906001600160a01b031681565b6102e36104923660046120e7565b610b00565b6102e36104a53660046120cc565b60036020526000908152604090205481565b6104ca6104c5366004612031565b610bdf565b005b6102e36d04ee2d6d415b85acef810000000081565b6102e3600b5481565b6104ca610ce8565b6102e36105003660046120cc565b60056020526000908152604090205481565b6102e3610d5b565b6102e36105283660046120e7565b610e78565b6102fe610f14565b6102e360095481565b61033161054c366004612066565b610f21565b6104ca61055f366004612113565b610f87565b6104ca6105723660046120cc565b61137d565b6102e3610585366004612031565b6113c9565b6102e3610598366004612148565b6113e8565b6102e36105ab366004612148565b6114f6565b6102e36105be366004612031565b611642565b6103677f000000000000000000000000000000000000000000000000000000000000000081565b6103677f000000000000000000000000000000000000000000000000000000000000000081565b6102e361061f3660046120cc565b611662565b6102e3610632366004612031565b600c6020526000908152604090205481565b6104ca61065236600461217b565b611684565b6104ca6118bc565b6102e361066d3660046120cc565b6001600160a01b031660009081526003602052604090205490565b6104ca6106963660046121ee565b611973565b6102e36106a9366004612221565b600460209081526000928352604080842090915290825290205481565b6102e3611a88565b6102e36106dc366004612031565b611af3565b6104ca6106ef3660046120cc565b611afe565b60008061070462093a8042612277565b9050600061071562093a804261228b565b9050600062093a80610727838261229f565b600c600061073660018861229f565b81526020019081526020016000205461074f91906122b2565b6107599190612277565b6000848152600c60205260408082205490516370a0823160e01b8152306004820152929350909183907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa1580156107d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107f791906122c9565b610801919061229f565b61080b919061229f565b90506d04ee2d6d415b85acef81000000008110610836576d04ee2d6d415b85acef8100000000610838565b805b94505050505090565b6000805461084e906122e2565b80601f016020809104026020016040519081016040528092919081815260200182805461087a906122e2565b80156108c75780601f1061089c576101008083540402835291602001916108c7565b820191906000526020600020905b8154815290600101906020018083116108aa57829003601f168201915b505050505081565b60025460009080156108f3576108ee6108e66106f4565b849083611b4a565b6108f5565b825b9392505050565b3360008181526004602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906109579086815260200190565b60405180910390a35060015b92915050565b60025460009080156108f3576108ee816109816106f4565b859190611b68565b6001600160a01b038316600090815260046020908152604080832033845290915281205460001981146109e5576109c0838261229f565b6001600160a01b03861660009081526004602090815260408083203384529091529020555b6001600160a01b03851660009081526003602052604081208054859290610a0d90849061229f565b90915550506001600160a01b038085166000818152600360205260409081902080548701905551909187169060008051602061241383398151915290610a569087815260200190565b60405180910390a3506001949350505050565b6000610a73610d5b565b610a7b611a88565b610a859190612277565b905090565b600081610a95611a88565b6109639190612277565b60007f00000000000000000000000000000000000000000000000000000000000000004614610ad057610a85611b8e565b507f000000000000000000000000000000000000000000000000000000000000000090565b6000610963826108cf565b6000610b0b83611af3565b905080600003610b505760405162461bcd60e51b815260206004820152600b60248201526a5a45524f5f53484152455360a81b60448201526064015b60405180910390fd5b610b856001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016333086611c28565b610b8f8282611cc4565b60408051848152602081018390526001600160a01b0384169133917fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d7910160405180910390a36109638382611d1e565b6006546001600160a01b0316331480610c0257506008546001600160a01b031633145b610c3e5760405162461bcd60e51b815260206004820152600d60248201526c27a7262c9027a822a920aa27a960991b6044820152606401610b47565b610c46610d5b565b8111610c9e5760405162461bcd60e51b815260206004820152602160248201527f4b206d757374206265206c6172676572207468616e20646272207265736572766044820152606560f81b6064820152608401610b47565b610ca6611a88565b600955600a81905542600b556040518181527f1fcc9c54f3c93fdac0b3691c0d36d64d222420c5ca56c6f1f28b43ab09cb8b7b9060200160405180910390a150565b6007546001600160a01b03163314610d345760405162461bcd60e51b815260206004820152600f60248201526e27a7262c902822a72224a723a3a7ab60891b6044820152606401610b47565b60078054600680546001600160a01b03199081166001600160a01b03841617909155169055565b60405163402914f560e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063402914f590602401602060405180830381865afa158015610dc2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de691906122c9565b6040516370a0823160e01b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015610e4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e6e91906122c9565b610a85919061231c565b6000610e83836113c9565b9050610eba6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016333084611c28565b610ec48284611cc4565b60408051828152602081018590526001600160a01b0384169133917fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d7910160405180910390a36109638184611d1e565b6001805461084e906122e2565b33600090815260036020526040812080548391908390610f4290849061229f565b90915550506001600160a01b03831660008181526003602052604090819020805485019055513390600080516020612413833981519152906109579086815260200190565b6001600160a01b038116610fcc5760405162461bcd60e51b815260206004820152600c60248201526b5a65726f206164647265737360a01b6044820152606401610b47565b604051630f41a04d60e11b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690631e83409a90602401600060405180830381600087803b15801561102d57600080fd5b505af1158015611041573d6000803e3d6000fd5b50505050600061104f611a88565b6040516370a0823160e01b81523060048201529091506000906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa1580156110b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110dd91906122c9565b905060006110eb858361229f565b90506000866110fa8486612277565b611104919061231c565b90508361111183836122b2565b101561114b5760405162461bcd60e51b8152602060048201526009602482015268125b9d985c9a585b9d60ba1b6044820152606401610b47565b6040516323b872dd60e01b8152336004820152306024820152604481018890527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906323b872dd906064016020604051808303816000875af11580156111be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111e2919061232f565b50604051637acb775760e01b8152600481018890523060248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690637acb775790604401600060405180830381600087803b15801561124b57600080fd5b505af115801561125f573d6000803e3d6000fd5b5050505086600c600062093a80426112779190612277565b81526020019081526020016000206000828254611294919061231c565b909155505060405163a9059cbb60e01b81526001600160a01b038681166004830152602482018890527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906044016020604051808303816000875af1158015611308573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061132c919061232f565b5060408051888152602081018890526001600160a01b0387169133917f89f5adc174562e07c9c9b1cae7109bbecb21cf9d1b2847e550042b8653c54a0e91015b60405180910390a350505050505050565b6006546001600160a01b031633146113a75760405162461bcd60e51b8152600401610b4790612351565b600880546001600160a01b0319166001600160a01b0392909216919091179055565b60025460009080156108f3576108ee6113e06106f4565b849083611b68565b60006113f384610969565b9050336001600160a01b03831614611463576001600160a01b038216600090815260046020908152604080832033845290915290205460001981146114615761143c828261229f565b6001600160a01b03841660009081526004602090815260408083203384529091529020555b505b61146d8482611df7565b6114778282611f00565b60408051858152602081018390526001600160a01b03808516929086169133917ffbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db910160405180910390a46108f56001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168486611f62565b6000336001600160a01b03831614611566576001600160a01b038216600090815260046020908152604080832033845290915290205460001981146115645761153f858261229f565b6001600160a01b03841660009081526004602090815260408083203384529091529020555b505b61156f84610af5565b9050806000036115af5760405162461bcd60e51b815260206004820152600b60248201526a5a45524f5f41535345545360a81b6044820152606401610b47565b6115b98185611df7565b6115c38285611f00565b60408051828152602081018690526001600160a01b03808516929086169133917ffbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db910160405180910390a46108f56001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168483611f62565b60025460009080156108f3576108ee8161165a6106f4565b859190611b4a565b6001600160a01b038116600090815260036020526040812054610963906108cf565b428410156116d45760405162461bcd60e51b815260206004820152601760248201527f5045524d49545f444541444c494e455f455850495245440000000000000000006044820152606401610b47565b600060016116e0610a9f565b6001600160a01b038a811660008181526005602090815260409182902080546001810190915582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98184015280840194909452938d166060840152608083018c905260a083019390935260c08083018b90528151808403909101815260e08301909152805192019190912061190160f01b6101008301526101028201929092526101228101919091526101420160408051601f198184030181528282528051602091820120600084529083018083525260ff871690820152606081018590526080810184905260a0016020604051602081039080840390855afa1580156117ec573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116158015906118225750876001600160a01b0316816001600160a01b0316145b61185f5760405162461bcd60e51b815260206004820152600e60248201526d24a72b20a624a22fa9a4a3a722a960911b6044820152606401610b47565b6001600160a01b0390811660009081526004602090815260408083208a8516808552908352928190208990555188815291928a16917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910161136c565b60405163095ea7b360e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116600483015260001960248301527f0000000000000000000000000000000000000000000000000000000000000000169063095ea7b3906044016020604051808303816000875af115801561194c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611970919061232f565b50565b6006546001600160a01b0316331461199d5760405162461bcd60e51b8152600401610b4790612351565b826001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031603611a0f5760405162461bcd60e51b815260206004820152600e60248201526d139bdd08185d5d1a1bdc9a5e995960921b6044820152606401610b47565b60405163a9059cbb60e01b81526001600160a01b0382811660048301526024820184905284169063a9059cbb906044016020604051808303816000875af1158015611a5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a82919061232f565b50505050565b600b5460009062093a80908290611a9f904261229f565b905081811115611ab357600a549250505090565b806000611ac0828561229f565b90508382600a54611ad191906122b2565b82600954611adf91906122b2565b611ae9919061231c565b6108389190612277565b600061096382611642565b6006546001600160a01b03163314611b285760405162461bcd60e51b8152600401610b4790612351565b600780546001600160a01b0319166001600160a01b0392909216919091179055565b6000826000190484118302158202611b6157600080fd5b5091020490565b6000826000190484118302158202611b7f57600080fd5b50910281810615159190040190565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6000604051611bc09190612373565b6040805191829003822060208301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b60006040516323b872dd60e01b81526001600160a01b03851660048201526001600160a01b03841660248201528260448201526020600060648360008a5af13d15601f3d1160016000511416171691505080611cbd5760405162461bcd60e51b81526020600482015260146024820152731514905394d1915497d19493d357d1905253115160621b6044820152606401610b47565b5050505050565b8060026000828254611cd6919061231c565b90915550506001600160a01b03821660008181526003602090815260408083208054860190555184815260008051602061241383398151915291015b60405180910390a35050565b670de0b6b3a76400006002541015611d725760405162461bcd60e51b81526020600482015260176024820152765368617265732062656c6f77204d494e5f53484152455360481b6044820152606401610b47565b604051637acb775760e01b8152600481018390523060248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690637acb7757906044015b600060405180830381600087803b158015611ddb57600080fd5b505af1158015611def573d6000803e3d6000fd5b505050505050565b611e08662386f26fc100008361231c565b611e106106f4565b1015611e545760405162461bcd60e51b8152602060048201526013602482015272496e73756666696369656e742061737365747360681b6044820152606401610b47565b670de0b6b3a764000081600254611e6b919061229f565b1015611eb35760405162461bcd60e51b81526020600482015260176024820152765368617265732062656c6f77204d494e5f53484152455360481b6044820152606401610b47565b6040516305c2fbcf60e31b8152600481018390527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690632e17de7890602401611dc1565b6001600160a01b03821660009081526003602052604081208054839290611f2890849061229f565b90915550506002805482900390556040518181526000906001600160a01b0384169060008051602061241383398151915290602001611d12565b600060405163a9059cbb60e01b81526001600160a01b0384166004820152826024820152602060006044836000895af13d15601f3d1160016000511416171691505080611a825760405162461bcd60e51b815260206004820152600f60248201526e1514905394d1915497d19052531151608a1b6044820152606401610b47565b600060208083528351808285015260005b8181101561201057858101830151858201604001528201611ff4565b506000604082860101526040601f19601f8301168501019250505092915050565b60006020828403121561204357600080fd5b5035919050565b80356001600160a01b038116811461206157600080fd5b919050565b6000806040838503121561207957600080fd5b6120828361204a565b946020939093013593505050565b6000806000606084860312156120a557600080fd5b6120ae8461204a565b92506120bc6020850161204a565b9150604084013590509250925092565b6000602082840312156120de57600080fd5b6108f58261204a565b600080604083850312156120fa57600080fd5b8235915061210a6020840161204a565b90509250929050565b60008060006060848603121561212857600080fd5b833592506020840135915061213f6040850161204a565b90509250925092565b60008060006060848603121561215d57600080fd5b8335925061216d6020850161204a565b915061213f6040850161204a565b600080600080600080600060e0888a03121561219657600080fd5b61219f8861204a565b96506121ad6020890161204a565b95506040880135945060608801359350608088013560ff811681146121d157600080fd5b9699959850939692959460a0840135945060c09093013592915050565b60008060006060848603121561220357600080fd5b61220c8461204a565b92506020840135915061213f6040850161204a565b6000806040838503121561223457600080fd5b61223d8361204a565b915061210a6020840161204a565b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000826122865761228661224b565b500490565b60008261229a5761229a61224b565b500690565b8181038181111561096357610963612261565b808202811582820484141761096357610963612261565b6000602082840312156122db57600080fd5b5051919050565b600181811c908216806122f657607f821691505b60208210810361231657634e487b7160e01b600052602260045260246000fd5b50919050565b8082018082111561096357610963612261565b60006020828403121561234157600080fd5b815180151581146108f557600080fd5b60208082526008908201526727a7262c9023a7ab60c11b604082015260600190565b600080835481600182811c91508083168061238f57607f831692505b602080841082036123ae57634e487b7160e01b86526022600452602486fd5b8180156123c257600181146123d757612404565b60ff1986168952841515850289019650612404565b60008a81526020902060005b868110156123fc5781548b8201529085019083016123e3565b505084890196505b50949897505050505050505056feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220745df9fd5bfac5bd3408f79ad9e2ba84a49247dd7f61cd6887ffe9a20917070064736f6c63430008150033000000000000000000000000865377367054516e17014ccded1e7d814edc9ce4000000000000000000000000e5f24791e273cb96a1f8e5b67bc2397f0ad9b8b4000000000000000000000000926df14a23be491164dcf93f4c468a50ef659d5b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e92d128f895cd635d3534039e740000000000
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106102d65760003560e01c80637ecebe0011610182578063c6e6f592116100e9578063d818f23a116100a2578063dd62ed3e1161007c578063dd62ed3e1461069b578063ee39e7a0146106c6578063ef8b30f7146106ce578063efdf0bb0146106e157600080fd5b8063d818f23a14610657578063d905777e1461065f578063dc2c256f1461068857600080fd5b8063c6e6f592146105b0578063c7ed69cd146105c3578063c86d6ae4146105ea578063ce96cb7714610611578063d04f688914610624578063d505accf1461064457600080fd5b8063b23adea61161013b578063b23adea614610551578063b3ab15fb14610564578063b3d7f6b914610577578063b460af941461058a578063ba0876521461059d578063c63d75b61461044957600080fd5b80637ecebe00146104f257806387a64c011461051257806394bf804d1461051a57806395d89b411461052d578063a08b06db14610535578063a9059cbb1461053e57600080fd5b806329a32d6611610241578063570ca735116101fa5780637153a20d116101d45780637153a20d146104b757806376b1d08f146104cc578063781f56de146104e15780637bc6729b146104ea57600080fd5b8063570ca735146104715780636e553f651461048457806370a082311461049757600080fd5b806329a32d66146103ce578063313ce567146103e15780633644e5151461041a57806338d52e0f14610422578063402d267d146104495780634cdad5061461045e57600080fd5b806318160ddd1161029357806318160ddd1461037f5780631cd1cf64146103885780631fcd30801461039157806323b872dd146103a057806325240810146103b357806325adc82d146103c657600080fd5b806301e1d114146102db57806306fdde03146102f657806307a2d13a1461030b578063095ea7b31461031e5780630a28a4771461034157806312d43a5114610354575b600080fd5b6102e36106f4565b6040519081526020015b60405180910390f35b6102fe610841565b6040516102ed9190611fe3565b6102e3610319366004612031565b6108cf565b61033161032c366004612066565b6108fc565b60405190151581526020016102ed565b6102e361034f366004612031565b610969565b600654610367906001600160a01b031681565b6040516001600160a01b0390911681526020016102ed565b6102e360025481565b6102e3600a5481565b6102e3670de0b6b3a764000081565b6103316103ae366004612090565b610989565b600754610367906001600160a01b031681565b6102e3610a69565b6102e36103dc366004612031565b610a8a565b6104087f000000000000000000000000000000000000000000000000000000000000001281565b60405160ff90911681526020016102ed565b6102e3610a9f565b6103677f000000000000000000000000865377367054516e17014ccded1e7d814edc9ce481565b6102e36104573660046120cc565b5060001990565b6102e361046c366004612031565b610af5565b600854610367906001600160a01b031681565b6102e36104923660046120e7565b610b00565b6102e36104a53660046120cc565b60036020526000908152604090205481565b6104ca6104c5366004612031565b610bdf565b005b6102e36d04ee2d6d415b85acef810000000081565b6102e3600b5481565b6104ca610ce8565b6102e36105003660046120cc565b60056020526000908152604090205481565b6102e3610d5b565b6102e36105283660046120e7565b610e78565b6102fe610f14565b6102e360095481565b61033161054c366004612066565b610f21565b6104ca61055f366004612113565b610f87565b6104ca6105723660046120cc565b61137d565b6102e3610585366004612031565b6113c9565b6102e3610598366004612148565b6113e8565b6102e36105ab366004612148565b6114f6565b6102e36105be366004612031565b611642565b6103677f000000000000000000000000ad038eb671c44b853887a7e32528fab35dc5d71081565b6103677f000000000000000000000000e5f24791e273cb96a1f8e5b67bc2397f0ad9b8b481565b6102e361061f3660046120cc565b611662565b6102e3610632366004612031565b600c6020526000908152604090205481565b6104ca61065236600461217b565b611684565b6104ca6118bc565b6102e361066d3660046120cc565b6001600160a01b031660009081526003602052604090205490565b6104ca6106963660046121ee565b611973565b6102e36106a9366004612221565b600460209081526000928352604080842090915290825290205481565b6102e3611a88565b6102e36106dc366004612031565b611af3565b6104ca6106ef3660046120cc565b611afe565b60008061070462093a8042612277565b9050600061071562093a804261228b565b9050600062093a80610727838261229f565b600c600061073660018861229f565b81526020019081526020016000205461074f91906122b2565b6107599190612277565b6000848152600c60205260408082205490516370a0823160e01b8152306004820152929350909183907f000000000000000000000000e5f24791e273cb96a1f8e5b67bc2397f0ad9b8b46001600160a01b0316906370a0823190602401602060405180830381865afa1580156107d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107f791906122c9565b610801919061229f565b61080b919061229f565b90506d04ee2d6d415b85acef81000000008110610836576d04ee2d6d415b85acef8100000000610838565b805b94505050505090565b6000805461084e906122e2565b80601f016020809104026020016040519081016040528092919081815260200182805461087a906122e2565b80156108c75780601f1061089c576101008083540402835291602001916108c7565b820191906000526020600020905b8154815290600101906020018083116108aa57829003601f168201915b505050505081565b60025460009080156108f3576108ee6108e66106f4565b849083611b4a565b6108f5565b825b9392505050565b3360008181526004602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906109579086815260200190565b60405180910390a35060015b92915050565b60025460009080156108f3576108ee816109816106f4565b859190611b68565b6001600160a01b038316600090815260046020908152604080832033845290915281205460001981146109e5576109c0838261229f565b6001600160a01b03861660009081526004602090815260408083203384529091529020555b6001600160a01b03851660009081526003602052604081208054859290610a0d90849061229f565b90915550506001600160a01b038085166000818152600360205260409081902080548701905551909187169060008051602061241383398151915290610a569087815260200190565b60405180910390a3506001949350505050565b6000610a73610d5b565b610a7b611a88565b610a859190612277565b905090565b600081610a95611a88565b6109639190612277565b60007f00000000000000000000000000000000000000000000000000000000000000014614610ad057610a85611b8e565b507fc2bba53d8cb40991bb394276e0a80013abb195e058977dda1f8f4106fe215f7d90565b6000610963826108cf565b6000610b0b83611af3565b905080600003610b505760405162461bcd60e51b815260206004820152600b60248201526a5a45524f5f53484152455360a81b60448201526064015b60405180910390fd5b610b856001600160a01b037f000000000000000000000000865377367054516e17014ccded1e7d814edc9ce416333086611c28565b610b8f8282611cc4565b60408051848152602081018390526001600160a01b0384169133917fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d7910160405180910390a36109638382611d1e565b6006546001600160a01b0316331480610c0257506008546001600160a01b031633145b610c3e5760405162461bcd60e51b815260206004820152600d60248201526c27a7262c9027a822a920aa27a960991b6044820152606401610b47565b610c46610d5b565b8111610c9e5760405162461bcd60e51b815260206004820152602160248201527f4b206d757374206265206c6172676572207468616e20646272207265736572766044820152606560f81b6064820152608401610b47565b610ca6611a88565b600955600a81905542600b556040518181527f1fcc9c54f3c93fdac0b3691c0d36d64d222420c5ca56c6f1f28b43ab09cb8b7b9060200160405180910390a150565b6007546001600160a01b03163314610d345760405162461bcd60e51b815260206004820152600f60248201526e27a7262c902822a72224a723a3a7ab60891b6044820152606401610b47565b60078054600680546001600160a01b03199081166001600160a01b03841617909155169055565b60405163402914f560e01b81523060048201526000907f000000000000000000000000e5f24791e273cb96a1f8e5b67bc2397f0ad9b8b46001600160a01b03169063402914f590602401602060405180830381865afa158015610dc2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de691906122c9565b6040516370a0823160e01b81523060048201527f000000000000000000000000ad038eb671c44b853887a7e32528fab35dc5d7106001600160a01b0316906370a0823190602401602060405180830381865afa158015610e4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e6e91906122c9565b610a85919061231c565b6000610e83836113c9565b9050610eba6001600160a01b037f000000000000000000000000865377367054516e17014ccded1e7d814edc9ce416333084611c28565b610ec48284611cc4565b60408051828152602081018590526001600160a01b0384169133917fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d7910160405180910390a36109638184611d1e565b6001805461084e906122e2565b33600090815260036020526040812080548391908390610f4290849061229f565b90915550506001600160a01b03831660008181526003602052604090819020805485019055513390600080516020612413833981519152906109579086815260200190565b6001600160a01b038116610fcc5760405162461bcd60e51b815260206004820152600c60248201526b5a65726f206164647265737360a01b6044820152606401610b47565b604051630f41a04d60e11b81523060048201527f000000000000000000000000e5f24791e273cb96a1f8e5b67bc2397f0ad9b8b46001600160a01b031690631e83409a90602401600060405180830381600087803b15801561102d57600080fd5b505af1158015611041573d6000803e3d6000fd5b50505050600061104f611a88565b6040516370a0823160e01b81523060048201529091506000906001600160a01b037f000000000000000000000000ad038eb671c44b853887a7e32528fab35dc5d71016906370a0823190602401602060405180830381865afa1580156110b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110dd91906122c9565b905060006110eb858361229f565b90506000866110fa8486612277565b611104919061231c565b90508361111183836122b2565b101561114b5760405162461bcd60e51b8152602060048201526009602482015268125b9d985c9a585b9d60ba1b6044820152606401610b47565b6040516323b872dd60e01b8152336004820152306024820152604481018890527f000000000000000000000000865377367054516e17014ccded1e7d814edc9ce46001600160a01b0316906323b872dd906064016020604051808303816000875af11580156111be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111e2919061232f565b50604051637acb775760e01b8152600481018890523060248201527f000000000000000000000000e5f24791e273cb96a1f8e5b67bc2397f0ad9b8b46001600160a01b031690637acb775790604401600060405180830381600087803b15801561124b57600080fd5b505af115801561125f573d6000803e3d6000fd5b5050505086600c600062093a80426112779190612277565b81526020019081526020016000206000828254611294919061231c565b909155505060405163a9059cbb60e01b81526001600160a01b038681166004830152602482018890527f000000000000000000000000ad038eb671c44b853887a7e32528fab35dc5d710169063a9059cbb906044016020604051808303816000875af1158015611308573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061132c919061232f565b5060408051888152602081018890526001600160a01b0387169133917f89f5adc174562e07c9c9b1cae7109bbecb21cf9d1b2847e550042b8653c54a0e91015b60405180910390a350505050505050565b6006546001600160a01b031633146113a75760405162461bcd60e51b8152600401610b4790612351565b600880546001600160a01b0319166001600160a01b0392909216919091179055565b60025460009080156108f3576108ee6113e06106f4565b849083611b68565b60006113f384610969565b9050336001600160a01b03831614611463576001600160a01b038216600090815260046020908152604080832033845290915290205460001981146114615761143c828261229f565b6001600160a01b03841660009081526004602090815260408083203384529091529020555b505b61146d8482611df7565b6114778282611f00565b60408051858152602081018390526001600160a01b03808516929086169133917ffbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db910160405180910390a46108f56001600160a01b037f000000000000000000000000865377367054516e17014ccded1e7d814edc9ce4168486611f62565b6000336001600160a01b03831614611566576001600160a01b038216600090815260046020908152604080832033845290915290205460001981146115645761153f858261229f565b6001600160a01b03841660009081526004602090815260408083203384529091529020555b505b61156f84610af5565b9050806000036115af5760405162461bcd60e51b815260206004820152600b60248201526a5a45524f5f41535345545360a81b6044820152606401610b47565b6115b98185611df7565b6115c38285611f00565b60408051828152602081018690526001600160a01b03808516929086169133917ffbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db910160405180910390a46108f56001600160a01b037f000000000000000000000000865377367054516e17014ccded1e7d814edc9ce4168483611f62565b60025460009080156108f3576108ee8161165a6106f4565b859190611b4a565b6001600160a01b038116600090815260036020526040812054610963906108cf565b428410156116d45760405162461bcd60e51b815260206004820152601760248201527f5045524d49545f444541444c494e455f455850495245440000000000000000006044820152606401610b47565b600060016116e0610a9f565b6001600160a01b038a811660008181526005602090815260409182902080546001810190915582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98184015280840194909452938d166060840152608083018c905260a083019390935260c08083018b90528151808403909101815260e08301909152805192019190912061190160f01b6101008301526101028201929092526101228101919091526101420160408051601f198184030181528282528051602091820120600084529083018083525260ff871690820152606081018590526080810184905260a0016020604051602081039080840390855afa1580156117ec573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116158015906118225750876001600160a01b0316816001600160a01b0316145b61185f5760405162461bcd60e51b815260206004820152600e60248201526d24a72b20a624a22fa9a4a3a722a960911b6044820152606401610b47565b6001600160a01b0390811660009081526004602090815260408083208a8516808552908352928190208990555188815291928a16917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910161136c565b60405163095ea7b360e01b81526001600160a01b037f000000000000000000000000e5f24791e273cb96a1f8e5b67bc2397f0ad9b8b48116600483015260001960248301527f000000000000000000000000865377367054516e17014ccded1e7d814edc9ce4169063095ea7b3906044016020604051808303816000875af115801561194c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611970919061232f565b50565b6006546001600160a01b0316331461199d5760405162461bcd60e51b8152600401610b4790612351565b826001600160a01b03167f000000000000000000000000ad038eb671c44b853887a7e32528fab35dc5d7106001600160a01b031603611a0f5760405162461bcd60e51b815260206004820152600e60248201526d139bdd08185d5d1a1bdc9a5e995960921b6044820152606401610b47565b60405163a9059cbb60e01b81526001600160a01b0382811660048301526024820184905284169063a9059cbb906044016020604051808303816000875af1158015611a5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a82919061232f565b50505050565b600b5460009062093a80908290611a9f904261229f565b905081811115611ab357600a549250505090565b806000611ac0828561229f565b90508382600a54611ad191906122b2565b82600954611adf91906122b2565b611ae9919061231c565b6108389190612277565b600061096382611642565b6006546001600160a01b03163314611b285760405162461bcd60e51b8152600401610b4790612351565b600780546001600160a01b0319166001600160a01b0392909216919091179055565b6000826000190484118302158202611b6157600080fd5b5091020490565b6000826000190484118302158202611b7f57600080fd5b50910281810615159190040190565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6000604051611bc09190612373565b6040805191829003822060208301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b60006040516323b872dd60e01b81526001600160a01b03851660048201526001600160a01b03841660248201528260448201526020600060648360008a5af13d15601f3d1160016000511416171691505080611cbd5760405162461bcd60e51b81526020600482015260146024820152731514905394d1915497d19493d357d1905253115160621b6044820152606401610b47565b5050505050565b8060026000828254611cd6919061231c565b90915550506001600160a01b03821660008181526003602090815260408083208054860190555184815260008051602061241383398151915291015b60405180910390a35050565b670de0b6b3a76400006002541015611d725760405162461bcd60e51b81526020600482015260176024820152765368617265732062656c6f77204d494e5f53484152455360481b6044820152606401610b47565b604051637acb775760e01b8152600481018390523060248201527f000000000000000000000000e5f24791e273cb96a1f8e5b67bc2397f0ad9b8b46001600160a01b031690637acb7757906044015b600060405180830381600087803b158015611ddb57600080fd5b505af1158015611def573d6000803e3d6000fd5b505050505050565b611e08662386f26fc100008361231c565b611e106106f4565b1015611e545760405162461bcd60e51b8152602060048201526013602482015272496e73756666696369656e742061737365747360681b6044820152606401610b47565b670de0b6b3a764000081600254611e6b919061229f565b1015611eb35760405162461bcd60e51b81526020600482015260176024820152765368617265732062656c6f77204d494e5f53484152455360481b6044820152606401610b47565b6040516305c2fbcf60e31b8152600481018390527f000000000000000000000000e5f24791e273cb96a1f8e5b67bc2397f0ad9b8b46001600160a01b031690632e17de7890602401611dc1565b6001600160a01b03821660009081526003602052604081208054839290611f2890849061229f565b90915550506002805482900390556040518181526000906001600160a01b0384169060008051602061241383398151915290602001611d12565b600060405163a9059cbb60e01b81526001600160a01b0384166004820152826024820152602060006044836000895af13d15601f3d1160016000511416171691505080611a825760405162461bcd60e51b815260206004820152600f60248201526e1514905394d1915497d19052531151608a1b6044820152606401610b47565b600060208083528351808285015260005b8181101561201057858101830151858201604001528201611ff4565b506000604082860101526040601f19601f8301168501019250505092915050565b60006020828403121561204357600080fd5b5035919050565b80356001600160a01b038116811461206157600080fd5b919050565b6000806040838503121561207957600080fd5b6120828361204a565b946020939093013593505050565b6000806000606084860312156120a557600080fd5b6120ae8461204a565b92506120bc6020850161204a565b9150604084013590509250925092565b6000602082840312156120de57600080fd5b6108f58261204a565b600080604083850312156120fa57600080fd5b8235915061210a6020840161204a565b90509250929050565b60008060006060848603121561212857600080fd5b833592506020840135915061213f6040850161204a565b90509250925092565b60008060006060848603121561215d57600080fd5b8335925061216d6020850161204a565b915061213f6040850161204a565b600080600080600080600060e0888a03121561219657600080fd5b61219f8861204a565b96506121ad6020890161204a565b95506040880135945060608801359350608088013560ff811681146121d157600080fd5b9699959850939692959460a0840135945060c09093013592915050565b60008060006060848603121561220357600080fd5b61220c8461204a565b92506020840135915061213f6040850161204a565b6000806040838503121561223457600080fd5b61223d8361204a565b915061210a6020840161204a565b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000826122865761228661224b565b500490565b60008261229a5761229a61224b565b500690565b8181038181111561096357610963612261565b808202811582820484141761096357610963612261565b6000602082840312156122db57600080fd5b5051919050565b600181811c908216806122f657607f821691505b60208210810361231657634e487b7160e01b600052602260045260246000fd5b50919050565b8082018082111561096357610963612261565b60006020828403121561234157600080fd5b815180151581146108f557600080fd5b60208082526008908201526727a7262c9023a7ab60c11b604082015260600190565b600080835481600182811c91508083168061238f57607f831692505b602080841082036123ae57634e487b7160e01b86526022600452602486fd5b8180156123c257600181146123d757612404565b60ff1986168952841515850289019650612404565b60008a81526020902060005b868110156123fc5781548b8201529085019083016123e3565b505084890196505b50949897505050505050505056feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220745df9fd5bfac5bd3408f79ad9e2ba84a49247dd7f61cd6887ffe9a20917070064736f6c63430008150033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000865377367054516e17014ccded1e7d814edc9ce4000000000000000000000000e5f24791e273cb96a1f8e5b67bc2397f0ad9b8b4000000000000000000000000926df14a23be491164dcf93f4c468a50ef659d5b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e92d128f895cd635d3534039e740000000000
-----Decoded View---------------
Arg [0] : _dola (address): 0x865377367054516e17014CcdED1e7d814EDC9ce4
Arg [1] : _savings (address): 0xE5f24791E273Cb96A1f8E5B67Bc2397F0AD9B8B4
Arg [2] : _gov (address): 0x926dF14a23BE491164dCF93f4c468A50ef659D5B
Arg [3] : _operator (address): 0x0000000000000000000000000000000000000000
Arg [4] : _K (uint256): 325000000000000000000000000000000000000000000
-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 000000000000000000000000865377367054516e17014ccded1e7d814edc9ce4
Arg [1] : 000000000000000000000000e5f24791e273cb96a1f8e5b67bc2397f0ad9b8b4
Arg [2] : 000000000000000000000000926df14a23be491164dcf93f4c468a50ef659d5b
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [4] : 000000000000000000000000000e92d128f895cd635d3534039e740000000000
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.
Add Token to MetaMask (Web3)