Contract Address Details

0xA3bb79484fE26bA758e801cC835650435d7E98e6

Contract Name
KumaVault
Creator
0x2f2d40–b3d676 at 0x8a07fd–2322d2
Balance
0 REI
Tokens
Fetching tokens...
Transactions
879 Transactions
Transfers
7,599 Transfers
Gas Used
96,501,085
Last Balance Update
282498
Contract name:
KumaVault




Optimization enabled
true
Compiler version
v0.8.7+commit.e28d00a7




Optimization runs
1000000
EVM Version
default




Verified at
2021-12-26T08:10:11.223783Z

Constructor Arguments

000000000000000000000000bf2c56466213f553fcf52810fe360dfe29e884710000000000000000000000006a4a8f768c233455d4996c8de8a7b91080c21bea

Arg [0] (address) : 0xbf2c56466213f553fcf52810fe360dfe29e88471
Arg [1] (address) : 0x6a4a8f768c233455d4996c8de8a7b91080c21bea

              

Contract source code

// Sources flattened with hardhat v2.4.1 https://hardhat.org

// File @openzeppelin/contracts/utils/Context.sol@v4.2.0

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/*
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}


// File @openzeppelin/contracts/access/Ownable.sol@v4.2.0

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _setOwner(_msgSender());
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _setOwner(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _setOwner(newOwner);
    }

    function _setOwner(address newOwner) private {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}


// File @openzeppelin/contracts/security/Pausable.sol@v4.2.0

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract Pausable is Context {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor() {
        _paused = false;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        require(!paused(), "Pausable: paused");
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        require(paused(), "Pausable: not paused");
        _;
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}


// File @openzeppelin/contracts/token/ERC20/IERC20.sol@v4.2.0

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `sender` to `recipient` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) external returns (bool);

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);
}


// File @openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol@v4.2.0

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the symbol of the token.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}


// File @openzeppelin/contracts/utils/Address.sol@v4.2.0

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    function _verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) private pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}


// File @openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol@v4.2.0

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;


/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}


// File contracts/KumaVault.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;





interface IKuma {
	function transfer(address recipient, uint256 amount) external returns (bool);
	function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
	function mint(uint256 amount) external;
	function burn(uint256 amount) external;
}

contract KumaVault is Ownable, Pausable {
	event Mint(address indexed sender, address collateral, uint256 amt, uint256 fee);
	event Redeem(address indexed sender, address collateral, uint256 amt, uint256 fee);
	event SetFee(uint256 min, uint256 max);
	event SetCollateral(address collateral, bool allowed);

	using SafeERC20 for IERC20;

	IKuma public immutable kuma;

	mapping (address => bool) public collaterals;
	mapping (address => bool) public redeemableCollaterals;

	// 1_000_000 = 100%
	// 10_000 = 1%
	uint256 constant public feeDivider = 1_000_000;
	uint256 public feeMin;
	uint256 public feeMax;

	// mintedKuma and mintedKumaPerCollateral use to calculate mint and redeem fee
	uint256 public mintedKuma;
	mapping (address => uint256) public mintedKumaPerCollateral;

	address public feeReceiver;

	constructor(
		IKuma kuma_,
		address feeReceiver_
	) {
		kuma = kuma_;
		feeReceiver = feeReceiver_;
	}

	function mint(address collateral_, uint256 cAmt_) external whenNotPaused {
		require(collaterals[collateral_], "!collateral");
		require(cAmt_ > 0, "empty amount");

		IERC20(collateral_).safeTransferFrom(msg.sender, address(this), cAmt_);

		uint256 feeAmt = getMintFee(collateral_, cAmt_);
		if (feeAmt > 0) {
			IERC20(collateral_).safeTransfer(feeReceiver, feeAmt);
		}
		cAmt_ -= feeAmt;

		// convert decimals
		uint256 kAmt = (cAmt_ * 1 ether) / (10 ** IERC20Metadata(collateral_).decimals());
		require(kAmt > 0, "empty receive amount");

		kuma.mint(kAmt);
		kuma.transfer(msg.sender, kAmt);
		mintedKuma += kAmt;
		mintedKumaPerCollateral[collateral_] += kAmt;

		emit Mint(msg.sender, collateral_, kAmt, feeAmt);
	}

	function getMintAmountOut(address collateral_, uint256 cAmt_) external view returns (uint256) {
		uint256 feeAmt = getMintFee(collateral_, cAmt_);
		cAmt_ -= feeAmt;
		uint256 kAmt = (cAmt_ * 1 ether) / (10 ** IERC20Metadata(collateral_).decimals());
		return kAmt;
	}

	function redeem(address collateral_, uint256 kAmt_) external {
		require(redeemableCollaterals[collateral_], "!collateral");
		require(kAmt_ > 0, "empty amount");

		kuma.transferFrom(msg.sender, address(this), kAmt_);

		// convert decimals
		uint256 cAmt = (kAmt_ * (10 ** IERC20Metadata(collateral_).decimals())) / 1 ether;
		require(cAmt > 0, "empty receive amount");

		kuma.burn(kAmt_);
		mintedKuma -= kAmt_;
		mintedKumaPerCollateral[collateral_] -= kAmt_;

		uint256 feeAmt = getRedeemFee(collateral_, cAmt);
		if (feeAmt > 0) {
			IERC20(collateral_).safeTransfer(feeReceiver, feeAmt);
		}
		cAmt -= feeAmt;
		IERC20(collateral_).safeTransfer(msg.sender, cAmt);

		emit Redeem(msg.sender, collateral_, kAmt_, feeAmt);
	}

	function getRedeemAmountOut(address collateral_, uint256 kAmt_) external view returns (uint256) {
		uint256 cAmt = (kAmt_ * (10 ** IERC20Metadata(collateral_).decimals())) / 1 ether;
		uint256 feeAmt = getRedeemFee(collateral_, cAmt);
		cAmt -= feeAmt;
		return cAmt;
	}

	function getCollateralRatio(address collateral_) public view returns (uint256) {
		if (mintedKuma == 0) {
			return 0;
		}
		return (mintedKumaPerCollateral[collateral_] * 1 ether) / mintedKuma;
	}

	function getMintFee(address collateral_, uint256 amt_) public view returns (uint256) {
		uint256 d = feeMax - feeMin;
		if (d == 0) {
			return feeMax;
		}

		uint256 feeMultiplier = feeMin + ((d * getCollateralRatio(collateral_)) / 1 ether);
		return (amt_ * feeMultiplier) / feeDivider;
	}

	function getRedeemFee(address collateral_, uint256 amt_) public view returns (uint256) {
		uint256 d = feeMax - feeMin;
		if (d == 0) {
			return feeMax;
		}

		uint256 feeMultiplier = feeMax - ((d * getCollateralRatio(collateral_)) / 1 ether);
		return (amt_ * feeMultiplier) / feeDivider;
	}

	function setCollateral(address collateral_, bool allowed_) external onlyOwner {
		require(collateral_ != address(kuma));

		collaterals[collateral_] = allowed_;
		if (allowed_) {
			redeemableCollaterals[collateral_] = true;
		}
		emit SetCollateral(collateral_, allowed_);
	}

	function setFee(uint256 min_, uint256 max_) external onlyOwner {
		require(min_ <= max_);
		require(max_ <= feeDivider / 100, "exceed possible fee"); // max 1%
		feeMin = min_;
		feeMax = max_;
		emit SetFee(min_, max_);
	}

	function setFeeReceiver(address feeReceiver_) external onlyOwner {
		require(feeReceiver_ != address(0), "nope");
		feeReceiver = feeReceiver_;
	}

	// pause uses to pause ONLY mint function
	function pause() external onlyOwner {
		_pause();
	}

	function unpause() external onlyOwner {
		_unpause();
	}
}
        

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"kuma_","internalType":"contract IKuma"},{"type":"address","name":"feeReceiver_","internalType":"address"}]},{"type":"event","name":"Mint","inputs":[{"type":"address","name":"sender","internalType":"address","indexed":true},{"type":"address","name":"collateral","internalType":"address","indexed":false},{"type":"uint256","name":"amt","internalType":"uint256","indexed":false},{"type":"uint256","name":"fee","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"Paused","inputs":[{"type":"address","name":"account","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"Redeem","inputs":[{"type":"address","name":"sender","internalType":"address","indexed":true},{"type":"address","name":"collateral","internalType":"address","indexed":false},{"type":"uint256","name":"amt","internalType":"uint256","indexed":false},{"type":"uint256","name":"fee","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"SetCollateral","inputs":[{"type":"address","name":"collateral","internalType":"address","indexed":false},{"type":"bool","name":"allowed","internalType":"bool","indexed":false}],"anonymous":false},{"type":"event","name":"SetFee","inputs":[{"type":"uint256","name":"min","internalType":"uint256","indexed":false},{"type":"uint256","name":"max","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Unpaused","inputs":[{"type":"address","name":"account","internalType":"address","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"collaterals","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"feeDivider","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"feeMax","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"feeMin","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"feeReceiver","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getCollateralRatio","inputs":[{"type":"address","name":"collateral_","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getMintAmountOut","inputs":[{"type":"address","name":"collateral_","internalType":"address"},{"type":"uint256","name":"cAmt_","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getMintFee","inputs":[{"type":"address","name":"collateral_","internalType":"address"},{"type":"uint256","name":"amt_","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getRedeemAmountOut","inputs":[{"type":"address","name":"collateral_","internalType":"address"},{"type":"uint256","name":"kAmt_","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getRedeemFee","inputs":[{"type":"address","name":"collateral_","internalType":"address"},{"type":"uint256","name":"amt_","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IKuma"}],"name":"kuma","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"mint","inputs":[{"type":"address","name":"collateral_","internalType":"address"},{"type":"uint256","name":"cAmt_","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"mintedKuma","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"mintedKumaPerCollateral","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"pause","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"paused","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"redeem","inputs":[{"type":"address","name":"collateral_","internalType":"address"},{"type":"uint256","name":"kAmt_","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"redeemableCollaterals","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setCollateral","inputs":[{"type":"address","name":"collateral_","internalType":"address"},{"type":"bool","name":"allowed_","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setFee","inputs":[{"type":"uint256","name":"min_","internalType":"uint256"},{"type":"uint256","name":"max_","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setFeeReceiver","inputs":[{"type":"address","name":"feeReceiver_","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"unpause","inputs":[]}]
            

Deployed ByteCode

0x608060405234801561001057600080fd5b50600436106101a35760003560e01c8063917b546c116100ee578063beb54e5311610097578063efdcd97411610071578063efdcd97414610390578063f2fde38b146103a3578063f4bc39c8146103b6578063ffbe9f1e146103dd57600080fd5b8063beb54e5314610337578063c9b308e31461034a578063eeb97d3b1461036d57600080fd5b8063b3f00674116100c8578063b3f00674146102f1578063b67d01e614610311578063b98994911461032457600080fd5b8063917b546c146102c157806394d31640146102cb5780639e350de6146102de57600080fd5b80635c975abb116101505780637f155e331161012a5780637f155e33146102715780638456cb591461027a5780638da5cb5b1461028257600080fd5b80635c975abb1461021a5780636d01870914610249578063715018a61461026957600080fd5b80633f4ba83a116101815780633f4ba83a146101ec57806340c10f19146101f457806352f7c9881461020757600080fd5b806315a3ba43146101a85780631e9a6950146101ce57806320a94f94146101e3575b600080fd5b6101bb6101b6366004611e20565b6103e6565b6040519081526020015b60405180910390f35b6101e16101dc366004611e72565b610446565b005b6101bb60035481565b6101e16108df565b6101e1610202366004611e72565b61096a565b6101e1610215366004611eb9565b610e72565b60005474010000000000000000000000000000000000000000900460ff165b60405190151581526020016101c5565b6101bb610257366004611e20565b60066020526000908152604090205481565b6101e1610fbf565b6101bb60055481565b6101e161104a565b60005473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101c5565b6101bb620f424081565b6101e16102d9366004611e3b565b6110d3565b6101bb6102ec366004611e72565b6112a1565b60075461029c9073ffffffffffffffffffffffffffffffffffffffff1681565b6101bb61031f366004611e72565b61131d565b6101bb610332366004611e72565b6113e0565b6101bb610345366004611e72565b611498565b610239610358366004611e20565b60026020526000908152604090205460ff1681565b61023961037b366004611e20565b60016020526000908152604090205460ff1681565b6101e161039e366004611e20565b6114f1565b6101e16103b1366004611e20565b611638565b61029c7f000000000000000000000000bf2c56466213f553fcf52810fe360dfe29e8847181565b6101bb60045481565b6000600554600014156103fb57506000919050565b60055473ffffffffffffffffffffffffffffffffffffffff831660009081526006602052604090205461043690670de0b6b3a76400006120e8565b6104409190611f83565b92915050565b73ffffffffffffffffffffffffffffffffffffffff821660009081526002602052604090205460ff166104da576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f21636f6c6c61746572616c00000000000000000000000000000000000000000060448201526064015b60405180910390fd5b60008111610544576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f656d70747920616d6f756e74000000000000000000000000000000000000000060448201526064016104d1565b6040517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018290527f000000000000000000000000bf2c56466213f553fcf52810fe360dfe29e8847173ffffffffffffffffffffffffffffffffffffffff16906323b872dd90606401602060405180830381600087803b1580156105d857600080fd5b505af11580156105ec573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106109190611e9c565b506000670de0b6b3a76400008373ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561066257600080fd5b505afa158015610676573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061069a9190611edb565b6106a590600a61201f565b6106af90846120e8565b6106b99190611f83565b905060008111610725576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f656d707479207265636569766520616d6f756e7400000000000000000000000060448201526064016104d1565b6040517f42966c68000000000000000000000000000000000000000000000000000000008152600481018390527f000000000000000000000000bf2c56466213f553fcf52810fe360dfe29e8847173ffffffffffffffffffffffffffffffffffffffff16906342966c6890602401600060405180830381600087803b1580156107ad57600080fd5b505af11580156107c1573d6000803e3d6000fd5b5050505081600560008282546107d79190612125565b909155505073ffffffffffffffffffffffffffffffffffffffff831660009081526006602052604081208054849290610811908490612125565b909155506000905061082384836112a1565b90508015610852576007546108529073ffffffffffffffffffffffffffffffffffffffff868116911683611768565b61085c8183612125565b915061087f73ffffffffffffffffffffffffffffffffffffffff85163384611768565b6040805173ffffffffffffffffffffffffffffffffffffffff861681526020810185905290810182905233907f3f693fff038bb8a046aa76d9516190ac7444f7d69cf952c4cbdc086fdef2d6fc906060015b60405180910390a250505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610960576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104d1565b610968611841565b565b60005474010000000000000000000000000000000000000000900460ff16156109ef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a207061757365640000000000000000000000000000000060448201526064016104d1565b73ffffffffffffffffffffffffffffffffffffffff821660009081526001602052604090205460ff16610a7e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f21636f6c6c61746572616c00000000000000000000000000000000000000000060448201526064016104d1565b60008111610ae8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f656d70747920616d6f756e74000000000000000000000000000000000000000060448201526064016104d1565b610b0a73ffffffffffffffffffffffffffffffffffffffff831633308461193a565b6000610b168383611498565b90508015610b4557600754610b459073ffffffffffffffffffffffffffffffffffffffff858116911683611768565b610b4f8183612125565b915060008373ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015610b9957600080fd5b505afa158015610bad573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bd19190611edb565b610bdc90600a61201f565b610bee84670de0b6b3a76400006120e8565b610bf89190611f83565b905060008111610c64576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f656d707479207265636569766520616d6f756e7400000000000000000000000060448201526064016104d1565b6040517fa0712d68000000000000000000000000000000000000000000000000000000008152600481018290527f000000000000000000000000bf2c56466213f553fcf52810fe360dfe29e8847173ffffffffffffffffffffffffffffffffffffffff169063a0712d6890602401600060405180830381600087803b158015610cec57600080fd5b505af1158015610d00573d6000803e3d6000fd5b50506040517fa9059cbb000000000000000000000000000000000000000000000000000000008152336004820152602481018490527f000000000000000000000000bf2c56466213f553fcf52810fe360dfe29e8847173ffffffffffffffffffffffffffffffffffffffff16925063a9059cbb9150604401602060405180830381600087803b158015610d9257600080fd5b505af1158015610da6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dca9190611e9c565b508060056000828254610ddd9190611f6b565b909155505073ffffffffffffffffffffffffffffffffffffffff841660009081526006602052604081208054839290610e17908490611f6b565b90915550506040805173ffffffffffffffffffffffffffffffffffffffff861681526020810183905290810183905233907f2f00e3cdd69a77be7ed215ec7b2a36784dd158f921fca79ac29deffa353fe6ee906060016108d1565b60005473ffffffffffffffffffffffffffffffffffffffff163314610ef3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104d1565b80821115610f0057600080fd5b610f0e6064620f4240611f83565b811115610f77576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f65786365656420706f737369626c65206665650000000000000000000000000060448201526064016104d1565b6003829055600481905560408051838152602081018390527f032dc6a2d839eb179729a55633fdf1c41a1fc4739394154117005db2b354b9b591015b60405180910390a15050565b60005473ffffffffffffffffffffffffffffffffffffffff163314611040576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104d1565b610968600061199e565b60005473ffffffffffffffffffffffffffffffffffffffff1633146110cb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104d1565b610968611a13565b60005473ffffffffffffffffffffffffffffffffffffffff163314611154576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104d1565b7f000000000000000000000000bf2c56466213f553fcf52810fe360dfe29e8847173ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156111ad57600080fd5b73ffffffffffffffffffffffffffffffffffffffff8216600090815260016020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001682158015919091179091556112545773ffffffffffffffffffffffffffffffffffffffff8216600090815260026020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555b6040805173ffffffffffffffffffffffffffffffffffffffff8416815282151560208201527ffc3dae94320e0e2d23100f30bb66b614bafb1f6d14336dd2a09a4538517f24d69101610fb3565b6000806003546004546112b49190612125565b9050806112c5575050600454610440565b6000670de0b6b3a76400006112d9866103e6565b6112e390846120e8565b6112ed9190611f83565b6004546112fa9190612125565b9050620f424061130a82866120e8565b6113149190611f83565b95945050505050565b600080670de0b6b3a76400008473ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561136f57600080fd5b505afa158015611383573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113a79190611edb565b6113b290600a61201f565b6113bc90856120e8565b6113c69190611f83565b905060006113d485836112a1565b90506113148183612125565b6000806113ed8484611498565b90506113f98184612125565b925060008473ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561144357600080fd5b505afa158015611457573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061147b9190611edb565b61148690600a61201f565b61130a85670de0b6b3a76400006120e8565b6000806003546004546114ab9190612125565b9050806114bc575050600454610440565b6000670de0b6b3a76400006114d0866103e6565b6114da90846120e8565b6114e49190611f83565b6003546112fa9190611f6b565b60005473ffffffffffffffffffffffffffffffffffffffff163314611572576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104d1565b73ffffffffffffffffffffffffffffffffffffffff81166115f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104d19060208082526004908201527f6e6f706500000000000000000000000000000000000000000000000000000000604082015260600190565b600780547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60005473ffffffffffffffffffffffffffffffffffffffff1633146116b9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104d1565b73ffffffffffffffffffffffffffffffffffffffff811661175c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016104d1565b6117658161199e565b50565b60405173ffffffffffffffffffffffffffffffffffffffff831660248201526044810182905261183c9084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152611aff565b505050565b60005474010000000000000000000000000000000000000000900460ff166118c5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f5061757361626c653a206e6f742070617573656400000000000000000000000060448201526064016104d1565b600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390a1565b60405173ffffffffffffffffffffffffffffffffffffffff808516602483015283166044820152606481018290526119989085907f23b872dd00000000000000000000000000000000000000000000000000000000906084016117ba565b50505050565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60005474010000000000000000000000000000000000000000900460ff1615611a98576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a207061757365640000000000000000000000000000000060448201526064016104d1565b600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16740100000000000000000000000000000000000000001790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586119103390565b6000611b61826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16611c0b9092919063ffffffff16565b80519091501561183c5780806020019051810190611b7f9190611e9c565b61183c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016104d1565b6060611c1a8484600085611c24565b90505b9392505050565b606082471015611cb6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016104d1565b843b611d1e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016104d1565b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051611d479190611efe565b60006040518083038185875af1925050503d8060008114611d84576040519150601f19603f3d011682016040523d82523d6000602084013e611d89565b606091505b5091509150611d99828286611da4565b979650505050505050565b60608315611db3575081611c1d565b825115611dc35782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104d19190611f1a565b803573ffffffffffffffffffffffffffffffffffffffff81168114611e1b57600080fd5b919050565b600060208284031215611e3257600080fd5b611c1d82611df7565b60008060408385031215611e4e57600080fd5b611e5783611df7565b91506020830135611e6781612197565b809150509250929050565b60008060408385031215611e8557600080fd5b611e8e83611df7565b946020939093013593505050565b600060208284031215611eae57600080fd5b8151611c1d81612197565b60008060408385031215611ecc57600080fd5b50508035926020909101359150565b600060208284031215611eed57600080fd5b815160ff81168114611c1d57600080fd5b60008251611f1081846020870161213c565b9190910192915050565b6020815260008251806020840152611f3981604085016020870161213c565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b60008219821115611f7e57611f7e612168565b500190565b600082611fb9577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b600181815b8085111561201757817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115611ffd57611ffd612168565b8085161561200a57918102915b93841c9390800290611fc3565b509250929050565b6000611c1d60ff84168360008261203857506001610440565b8161204557506000610440565b816001811461205b576002811461206557612081565b6001915050610440565b60ff84111561207657612076612168565b50506001821b610440565b5060208310610133831016604e8410600b84101617156120a4575081810a610440565b6120ae8383611fbe565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156120e0576120e0612168565b029392505050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561212057612120612168565b500290565b60008282101561213757612137612168565b500390565b60005b8381101561215757818101518382015260200161213f565b838111156119985750506000910152565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b801515811461176557600080fdfea2646970667358221220875e64ab428fd0197131654a774a254f293817e1e18c7bbf8a0cb6dd4cdd001064736f6c63430008070033