More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 105 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Withdraw Any Tok... | 15035697 | 898 days ago | IN | 0 ETH | 0.00285575 | ||||
Withdraw Any Tok... | 15035080 | 898 days ago | IN | 0 ETH | 0.00321871 | ||||
Withdraw Any Tok... | 15034195 | 898 days ago | IN | 0 ETH | 0.00093311 | ||||
Forge | 14565243 | 975 days ago | IN | 0 ETH | 0.07148281 | ||||
Approve | 14565236 | 975 days ago | IN | 0 ETH | 0.00506953 | ||||
Set Deposit | 14563353 | 975 days ago | IN | 0 ETH | 0.00055418 | ||||
Deposit | 14563318 | 975 days ago | IN | 0 ETH | 0.00184331 | ||||
Deposit | 14561070 | 976 days ago | IN | 0 ETH | 0.00335955 | ||||
Deposit | 14552183 | 977 days ago | IN | 0 ETH | 0.00312733 | ||||
Deposit | 14550035 | 977 days ago | IN | 0 ETH | 0.00348329 | ||||
Deposit | 14546345 | 978 days ago | IN | 0 ETH | 0.00600019 | ||||
Deposit | 14546199 | 978 days ago | IN | 0 ETH | 0.00638473 | ||||
Deposit | 14542205 | 979 days ago | IN | 0 ETH | 0.00488082 | ||||
Deposit | 14525613 | 981 days ago | IN | 0 ETH | 0.00465532 | ||||
Deposit | 14521040 | 982 days ago | IN | 0 ETH | 0.00676302 | ||||
Withdraw Any Tok... | 14521014 | 982 days ago | IN | 0 ETH | 0.00411475 | ||||
Deposit | 14520986 | 982 days ago | IN | 0 ETH | 0.00842048 | ||||
Deposit | 14518316 | 982 days ago | IN | 0 ETH | 0.00443041 | ||||
Deposit | 14517309 | 982 days ago | IN | 0 ETH | 0.00468464 | ||||
Deposit | 14517046 | 983 days ago | IN | 0 ETH | 0.00433209 | ||||
Deposit | 14516945 | 983 days ago | IN | 0 ETH | 0.00754468 | ||||
Deposit | 14511013 | 983 days ago | IN | 0 ETH | 0.00290331 | ||||
Deposit | 14506903 | 984 days ago | IN | 0 ETH | 0.00628627 | ||||
Deposit | 14506309 | 984 days ago | IN | 0 ETH | 0.00326269 | ||||
Deposit | 14502647 | 985 days ago | IN | 0 ETH | 0.00707155 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0xfC9E0450...7d8Bf0d9c The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
DynasetForgeCoins
Compiler Version
v0.6.4+commit.1dca32f3
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.6.4; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "./interfaces/IWETH.sol"; import "./interfaces/OneInchAgregator.sol"; import "./interfaces/IDynaset.sol"; contract DynasetForgeCoins is AccessControl { using SafeMath for uint256; // uses the default admin role bytes32 constant public CONTROLLER_ROLE = DEFAULT_ADMIN_ROLE; bytes32 constant public BLACK_SMITH = keccak256(abi.encode("BLACK_SMITH")); mapping(address => uint256) public tokenBalanceOf; mapping(address => uint256) public outputBalanceOf; using SafeMath for uint256; bool isWithdrawActive = false; IERC20 public Dynaset; IERC20 public TokenContrib; uint256 public cap; // boolean to simulate cooldown bool withdraw_enabled = false; bool deposit_enabled = false; // contribution uint256 minContribution; uint256 maxContribution; // withdraw fee uint256 public OPERATING_FEE = 100; // 1% fees uint256 public constant WITHDRAW_FEE_MAX = 1000; // 10% fees max uint256 public constant WITHDRAW_FEE_FACTOR = 10000; uint256 public total_fee; address constant AGGREGATION_ROUTER_V4 = 0x1111111254fb6c44bAC0beD2854e76F90643097d;// https://etherscan.io/address/0x1111111254fb6c44bAC0beD2854e76F90643097d OneInchAgregator constant OneInch = OneInchAgregator( 0x1111111254fb6c44bAC0beD2854e76F90643097d ); event Deposit(address user, uint256 amount); event WithdrawETH(address user, uint256 amount, address receiver); event WithdrawOuput(address user, uint256 amount, address receiver); event Forge(address user, uint256 amount, uint256 price); event CapSet(uint256 max); event Initialised(uint256 min, uint256 max); event FeeSet(uint256 fee); event DepositSet(bool set); event WithdrawSet(bool set); constructor( address _blacksmith, address _dynaset, address _token ) public { _setupRole(BLACK_SMITH, _blacksmith); Dynaset = IERC20(_dynaset); TokenContrib = IERC20(_token); } modifier onlyRole(bytes32 _role) { require(hasRole(_role, msg.sender), "AUTH_FAILED"); _; } // Initialisation contribution function initializeContribution(uint256 _min, uint256 _max) external onlyRole(BLACK_SMITH) { minContribution = _min; maxContribution = _max; emit Initialised(_min,_max); } function getUserContribution(address user) external view returns (uint256){ return tokenBalanceOf[user]; } function getForgeBalance () external view returns(uint256) { return TokenContrib.balanceOf(address(this)); } function Approve(address dest,address token,uint256 amount) external onlyRole(BLACK_SMITH) { IERC20(token).approve(dest, amount); } // _maxprice should be equal to the sum of _receivers. // this variable is needed because in the time between calling this function // and execution, the _receiver amounts can differ. function forge( address[] calldata _receivers, address _dynaset, uint256 _outputAmount, uint256 _maxPrice,//maximum eth contributed by the receivers uint256 _realPrice ) external onlyRole(BLACK_SMITH) { require(_realPrice <= _maxPrice, "PRICE_ERROR"); require(_receivers.length > 0, "RECEIVERS_NULL"); uint256 totalInputAmount = 0; for (uint256 i = 0; i < _receivers.length; i++) { uint256 userAmount = tokenBalanceOf[_receivers[i]]; if (totalInputAmount == _realPrice) { break; } else if (totalInputAmount.add(userAmount) <= _realPrice) { totalInputAmount = totalInputAmount.add(userAmount); } else { userAmount = _realPrice.sub(totalInputAmount); // e.g. totalInputAmount = realPrice totalInputAmount = totalInputAmount.add(userAmount); } tokenBalanceOf[_receivers[i]] = tokenBalanceOf[_receivers[i]].sub( userAmount ); uint256 userForgeAmount = _outputAmount.mul(userAmount).div( _realPrice ); outputBalanceOf[_receivers[i]] = outputBalanceOf[_receivers[i]].add( userForgeAmount ); emit Forge(_receivers[i], userForgeAmount, userAmount); } // Provided balances are too low. require(totalInputAmount == _realPrice, "INSUFFICIENT_FUNDS"); _mintDynaset(_dynaset, _outputAmount); } function _mintDynaset(address _dynaset, uint256 _dynasetAmount) internal { (address[] memory tokens, uint256[] memory amounts) = IDynaset(_dynaset) .calcTokensForAmount(_dynasetAmount); //check if enough tokens for swap for (uint256 i = 0; i < tokens.length; i++) { address token = tokens[i]; uint256 amount = amounts[i]; IERC20 underlygin_token = IERC20(token); require (underlygin_token.balanceOf(address(this)) >= amount,"not enough tokens" ); //IERC20(token).approve(_dynaset, amount); } IDynaset dynaset = IDynaset(_dynaset); dynaset.joinDynaset(_dynasetAmount); } //swap tokens get quote amount from oneinch api for each underlying, weth-> underlying function _swapToToken( address _token,//weth uint256 _amount,//amount to send uint256 minReturn, bytes32[] calldata _data,//data from one inch address _dynaset // approve the dynaset for the swapped token ) external payable onlyRole(BLACK_SMITH) { require(IERC20(_token).balanceOf(address(this)) >= _amount, "swap: not enough funds to swap"); IERC20(_token).approve(AGGREGATION_ROUTER_V4, _amount); OneInch.unoswap(_token,_amount,minReturn,_data); } function deposit(uint256 amount) external { require(deposit_enabled, "deposit: not enabeled"); require (TokenContrib.balanceOf(address(msg.sender)) >= amount,"not enough tokens"); require(minContribution <= amount, "deposit: amount < min"); uint256 contribution = tokenBalanceOf[msg.sender].add(amount); require(contribution <= maxContribution, "deposit: amount > max"); require(TokenContrib.balanceOf(address(this)) <= cap, "MAX_CAP"); TokenContrib.transferFrom(msg.sender,address(this),amount); tokenBalanceOf[msg.sender] = tokenBalanceOf[msg.sender].add(amount); emit Deposit(msg.sender, amount); } function withdrawAll(address payable _receiver) external { withdrawOutput(_receiver); } function withdrawToken(uint256 _amount, address _receiver) external { require(withdraw_enabled, "withdraw: not enabled"); require(tokenBalanceOf[msg.sender] >=_amount, "balance insufficient"); tokenBalanceOf[msg.sender] = tokenBalanceOf[msg.sender].sub(_amount); TokenContrib.transfer(_receiver,_amount); emit WithdrawETH(msg.sender, _amount, _receiver); } function withdrawOutput(address _receiver) public { require(withdraw_enabled, "withdraw: not enabled"); // withdraw fee uint256 withdraw_fee = outputBalanceOf[msg.sender] .mul(WITHDRAW_FEE_FACTOR .sub(OPERATING_FEE)) .div(WITHDRAW_FEE_FACTOR); uint256 final_fee = outputBalanceOf[msg.sender].sub(withdraw_fee); uint256 _amount = outputBalanceOf[msg.sender].sub(final_fee); require(Dynaset.balanceOf(address(this))>=_amount, "balance insufficient"); Dynaset.transfer(_receiver, _amount); total_fee = total_fee.add(final_fee); outputBalanceOf[msg.sender] = 0; } function setCap(uint256 _cap) external onlyRole(BLACK_SMITH) { cap = _cap; emit CapSet(_cap); } function getCap() external view returns (uint256) { return cap; } function setWithdraw(bool _enable) external onlyRole(BLACK_SMITH) { withdraw_enabled = _enable; emit WithdrawSet(_enable); } function setDeposit(bool _enable) external onlyRole(BLACK_SMITH) { deposit_enabled = _enable; emit DepositSet(_enable); } function withdrawFee() external onlyRole(BLACK_SMITH) { require(Dynaset.balanceOf(address(this))>=total_fee, "balance insufficient"); Dynaset.transfer(msg.sender, total_fee); total_fee = 0; } function withdrawAnyTokens(address token,uint256 amount) external onlyRole(BLACK_SMITH) { IERC20 Token = IERC20(token); require(Token.balanceOf(address(this))>=amount, "balance insufficient"); Token.transfer(msg.sender, amount); } function withdrawEth(uint256 amount) external onlyRole(BLACK_SMITH) { require(address(this).balance >=amount, "balance insufficient"); msg.sender.transfer(amount); } function setFee(uint _feeAmount) external onlyRole(BLACK_SMITH) { require(WITHDRAW_FEE_MAX > _feeAmount , "setFee: FEE must be inferior of 10%"); OPERATING_FEE = _feeAmount; emit FeeSet(_feeAmount); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. */ library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping (bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement. bytes32 lastvalue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastvalue; // Update the index for the moved value set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { require(set._values.length > index, "EnumerableSet: index out of bounds"); return set._values[index]; } // Bytes32Set struct Bytes32Set { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values on the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <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 GSN 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 payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.2 <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; // solhint-disable-next-line no-inline-assembly 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"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (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"); // solhint-disable-next-line avoid-low-level-calls (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"); // solhint-disable-next-line avoid-low-level-calls (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"); // solhint-disable-next-line avoid-low-level-calls (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 // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b > a) return (false, 0); return (true, a - b); } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a / b); } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a % b); } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: subtraction overflow"); return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) return 0; uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: division by zero"); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: modulo by zero"); return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); return a - b; } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryDiv}. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a % b; } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "../utils/EnumerableSet.sol"; import "../utils/Address.sol"; import "../utils/Context.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ``` * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. */ abstract contract AccessControl is Context { using EnumerableSet for EnumerableSet.AddressSet; using Address for address; struct RoleData { EnumerableSet.AddressSet members; bytes32 adminRole; } mapping (bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view returns (bool) { return _roles[role].members.contains(account); } /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) public view returns (uint256) { return _roles[role].members.length(); } /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) public view returns (address) { return _roles[role].members.at(index); } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) public virtual { require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to grant"); _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) public virtual { require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to revoke"); _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) public virtual { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { emit RoleAdminChanged(role, _roles[role].adminRole, adminRole); _roles[role].adminRole = adminRole; } function _grantRole(bytes32 role, address account) private { if (_roles[role].members.add(account)) { emit RoleGranted(role, account, _msgSender()); } } function _revokeRole(bytes32 role, address account) private { if (_roles[role].members.remove(account)) { emit RoleRevoked(role, account, _msgSender()); } } }
interface OneInchAgregator { function unoswap(address srcToken,uint256 amount,uint256 minReturn,bytes32[] calldata _pools) external payable returns(uint256 returnAmount); function uniswapV3Swap(uint256 amount,uint256 minReturn,uint256[] calldata pools) external payable returns(uint256 returnAmount); }
import "./IERC20.sol"; interface IWETH is IERC20 { function deposit() external payable; function withdraw(uint wad) external; }
interface IERC20 { event Approval(address indexed _src, address indexed _dst, uint _amount); event Transfer(address indexed _src, address indexed _dst, uint _amount); function totalSupply() external view returns (uint); function balanceOf(address _whom) external view returns (uint); function allowance(address _src, address _dst) external view returns (uint); function approve(address _dst, uint _amount) external returns (bool); function transfer(address _dst, uint _amount) external returns (bool); function transferFrom( address _src, address _dst, uint _amount ) external returns (bool); }
import "./IERC20.sol"; interface IDynaset is IERC20{ function joinDynaset(uint256 _amount) external; function exitDynaset(uint256 _amount) external; function calcTokensForAmount(uint256 _amount) external view returns (address[] memory tokens, uint256[] memory amounts); }
{ "remappings": [], "optimizer": { "enabled": true, "runs": 200 }, "evmVersion": "istanbul", "libraries": {}, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_blacksmith","type":"address"},{"internalType":"address","name":"_dynaset","type":"address"},{"internalType":"address","name":"_token","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"max","type":"uint256"}],"name":"CapSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"set","type":"bool"}],"name":"DepositSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"fee","type":"uint256"}],"name":"FeeSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"}],"name":"Forge","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"min","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"max","type":"uint256"}],"name":"Initialised","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"address","name":"receiver","type":"address"}],"name":"WithdrawETH","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"address","name":"receiver","type":"address"}],"name":"WithdrawOuput","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"set","type":"bool"}],"name":"WithdrawSet","type":"event"},{"inputs":[{"internalType":"address","name":"dest","type":"address"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"BLACK_SMITH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CONTROLLER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"Dynaset","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OPERATING_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TokenContrib","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WITHDRAW_FEE_FACTOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WITHDRAW_FEE_MAX","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"minReturn","type":"uint256"},{"internalType":"bytes32[]","name":"_data","type":"bytes32[]"},{"internalType":"address","name":"_dynaset","type":"address"}],"name":"_swapToToken","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"cap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_receivers","type":"address[]"},{"internalType":"address","name":"_dynaset","type":"address"},{"internalType":"uint256","name":"_outputAmount","type":"uint256"},{"internalType":"uint256","name":"_maxPrice","type":"uint256"},{"internalType":"uint256","name":"_realPrice","type":"uint256"}],"name":"forge","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getCap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getForgeBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getUserContribution","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_min","type":"uint256"},{"internalType":"uint256","name":"_max","type":"uint256"}],"name":"initializeContribution","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"outputBalanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_cap","type":"uint256"}],"name":"setCap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_enable","type":"bool"}],"name":"setDeposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_feeAmount","type":"uint256"}],"name":"setFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_enable","type":"bool"}],"name":"setWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"tokenBalanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"total_fee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address payable","name":"_receiver","type":"address"}],"name":"withdrawAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawAnyTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawEth","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_receiver","type":"address"}],"name":"withdrawOutput","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_receiver","type":"address"}],"name":"withdrawToken","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Deployed Bytecode
0x60806040526004361061021a5760003560e01c8063a217fddf11610123578063d547741f116100ab578063e42c08f21161006f578063e42c08f214610818578063e82eab2e1461084b578063e941fa7814610877578063ef1a0a711461088c578063fa09e630146108a15761021a565b8063d547741f146106ec578063d6ea4c1014610725578063d98b2adc14610758578063da3691ee1461076d578063e1900c7d146107825761021a565b8063bb8b2b47116100f2578063bb8b2b4714610617578063be4b17721461064a578063c311d04914610683578063ca15c873146106ad578063d0bdbd28146106d75761021a565b8063a217fddf1461021f578063aa8cc1f6146105a5578063b13820a7146105ba578063b6b55f25146105ed5761021a565b80635778bb5c116101a65780636e11fb1b116101755780636e11fb1b1461048857806378172de4146104cb5780639010d07c146104f757806391d1485414610543578063948fa066146105905761021a565b80635778bb5c146103fb578063639610691461041057806363a85dab1461044957806369fe0e2d1461045e5761021a565b806334c79baf116101ed57806334c79baf1461033e578063355274ea1461036e57806336568abe1461038357806347786d37146103bc578063554d578d146103e65761021a565b8063092c5b3b1461021f5780630b20409c14610246578063248a9ca3146102db5780632f2ff15d14610305575b600080fd5b34801561022b57600080fd5b506102346108d4565b60408051918252519081900360200190f35b6102d9600480360360a081101561025c57600080fd5b6001600160a01b038235169160208101359160408201359190810190608081016060820135600160201b81111561029257600080fd5b8201836020820111156102a457600080fd5b803590602001918460208302840111600160201b831117156102c557600080fd5b9193509150356001600160a01b03166108d9565b005b3480156102e757600080fd5b50610234600480360360208110156102fe57600080fd5b5035610b9b565b34801561031157600080fd5b506102d96004803603604081101561032857600080fd5b50803590602001356001600160a01b0316610bb0565b34801561034a57600080fd5b506102d96004803603604081101561036157600080fd5b5080359060200135610c1c565b34801561037a57600080fd5b50610234610cf5565b34801561038f57600080fd5b506102d9600480360360408110156103a657600080fd5b50803590602001356001600160a01b0316610cfb565b3480156103c857600080fd5b506102d9600480360360208110156103df57600080fd5b5035610d5c565b3480156103f257600080fd5b50610234610e27565b34801561040757600080fd5b50610234610e2d565b34801561041c57600080fd5b506102d96004803603604081101561043357600080fd5b506001600160a01b038135169060200135610ead565b34801561045557600080fd5b5061023461107d565b34801561046a57600080fd5b506102d96004803603602081101561048157600080fd5b5035611083565b34801561049457600080fd5b506102d9600480360360608110156104ab57600080fd5b506001600160a01b0381358116916020810135909116906040013561118e565b3480156104d757600080fd5b506102d9600480360360208110156104ee57600080fd5b5035151561127d565b34801561050357600080fd5b506105276004803603604081101561051a57600080fd5b508035906020013561135c565b604080516001600160a01b039092168252519081900360200190f35b34801561054f57600080fd5b5061057c6004803603604081101561056657600080fd5b50803590602001356001600160a01b0316611383565b604080519115158252519081900360200190f35b34801561059c57600080fd5b506105276113a1565b3480156105b157600080fd5b506105276113b5565b3480156105c657600080fd5b50610234600480360360208110156105dd57600080fd5b50356001600160a01b03166113c4565b3480156105f957600080fd5b506102d96004803603602081101561061057600080fd5b50356113d6565b34801561062357600080fd5b506102346004803603602081101561063a57600080fd5b50356001600160a01b031661175d565b34801561065657600080fd5b506102d96004803603604081101561066d57600080fd5b50803590602001356001600160a01b0316611778565b34801561068f57600080fd5b506102d9600480360360208110156106a657600080fd5b5035611922565b3480156106b957600080fd5b50610234600480360360208110156106d057600080fd5b5035611a2f565b3480156106e357600080fd5b50610234611a46565b3480156106f857600080fd5b506102d96004803603604081101561070f57600080fd5b50803590602001356001600160a01b0316611a4c565b34801561073157600080fd5b506102d96004803603602081101561074857600080fd5b50356001600160a01b0316611aa5565b34801561076457600080fd5b50610234611d04565b34801561077957600080fd5b50610234611d0a565b34801561078e57600080fd5b506102d9600480360360a08110156107a557600080fd5b810190602081018135600160201b8111156107bf57600080fd5b8201836020820111156107d157600080fd5b803590602001918460208302840111600160201b831117156107f257600080fd5b91935091506001600160a01b038135169060208101359060408101359060600135611d53565b34801561082457600080fd5b506102346004803603602081101561083b57600080fd5b50356001600160a01b031661212b565b34801561085757600080fd5b506102d96004803603602081101561086e57600080fd5b5035151561213d565b34801561088357600080fd5b506102d9612214565b34801561089857600080fd5b506102346123fa565b3480156108ad57600080fd5b506102d9600480360360208110156108c457600080fd5b50356001600160a01b0316612400565b600081565b60405160200180806020018281038252600b8152602001806a08498828696bea69a92a8960ab1b815250602001915050604051602081830303815290604052805190602001206109298133611383565b610968576040805162461bcd60e51b815260206004820152600b60248201526a1055551217d1905253115160aa1b604482015290519081900360640190fd5b604080516370a0823160e01b8152306004820152905187916001600160a01b038a16916370a0823191602480820192602092909190829003018186803b1580156109b157600080fd5b505afa1580156109c5573d6000803e3d6000fd5b505050506040513d60208110156109db57600080fd5b50511015610a30576040805162461bcd60e51b815260206004820152601e60248201527f737761703a206e6f7420656e6f7567682066756e647320746f20737761700000604482015290519081900360640190fd5b6040805163095ea7b360e01b8152731111111254fb6c44bac0bed2854e76f90643097d60048201526024810188905290516001600160a01b0389169163095ea7b39160448083019260209291908290030181600087803b158015610a9357600080fd5b505af1158015610aa7573d6000803e3d6000fd5b505050506040513d6020811015610abd57600080fd5b50506040516305d2b6d960e31b81526001600160a01b03881660048201908152602482018890526044820187905260806064830190815260848301869052731111111254fb6c44bac0bed2854e76f90643097d92632e95b6c8928b928b928b928b928b9260a401846020850280828437600081840152601f19601f8201169050808301925050509650505050505050602060405180830381600087803b158015610b6657600080fd5b505af1158015610b7a573d6000803e3d6000fd5b505050506040513d6020811015610b9057600080fd5b505050505050505050565b60009081526020819052604090206002015490565b600082815260208190526040902060020154610bd390610bce61240c565b611383565b610c0e5760405162461bcd60e51b815260040180806020018281038252602f815260200180612b7f602f913960400191505060405180910390fd5b610c188282612410565b5050565b60405160200180806020018281038252600b8152602001806a08498828696bea69a92a8960ab1b81525060200191505060405160208183030381529060405280519060200120610c6c8133611383565b610cab576040805162461bcd60e51b815260206004820152600b60248201526a1055551217d1905253115160aa1b604482015290519081900360640190fd5b60078390556008829055604080518481526020810184905281517f1679d84db557931d4d947dd78a2a7594270aaf3e4f8d92b791dd19da2f83126e929181900390910190a1505050565b60055481565b610d0361240c565b6001600160a01b0316816001600160a01b031614610d525760405162461bcd60e51b815260040180806020018281038252602f815260200180612c22602f913960400191505060405180910390fd5b610c18828261247f565b60405160200180806020018281038252600b8152602001806a08498828696bea69a92a8960ab1b81525060200191505060405160208183030381529060405280519060200120610dac8133611383565b610deb576040805162461bcd60e51b815260206004820152600b60248201526a1055551217d1905253115160aa1b604482015290519081900360640190fd5b60058290556040805183815290517f9872d5eb566b79923d043f1b59aca655ca80a2bb5b6bca4824e515b0e398902f9181900360200190a15050565b60055490565b60048054604080516370a0823160e01b81523093810193909352516000926001600160a01b03909216916370a08231916024808301926020929190829003018186803b158015610e7c57600080fd5b505afa158015610e90573d6000803e3d6000fd5b505050506040513d6020811015610ea657600080fd5b5051905090565b60405160200180806020018281038252600b8152602001806a08498828696bea69a92a8960ab1b81525060200191505060405160208183030381529060405280519060200120610efd8133611383565b610f3c576040805162461bcd60e51b815260206004820152600b60248201526a1055551217d1905253115160aa1b604482015290519081900360640190fd5b604080516370a0823160e01b81523060048201529051849184916001600160a01b038416916370a08231916024808301926020929190829003018186803b158015610f8657600080fd5b505afa158015610f9a573d6000803e3d6000fd5b505050506040513d6020811015610fb057600080fd5b50511015610ffc576040805162461bcd60e51b815260206004820152601460248201527318985b185b98d9481a5b9cdd59999a58da595b9d60621b604482015290519081900360640190fd5b6040805163a9059cbb60e01b81523360048201526024810185905290516001600160a01b0383169163a9059cbb9160448083019260209291908290030181600087803b15801561104b57600080fd5b505af115801561105f573d6000803e3d6000fd5b505050506040513d602081101561107557600080fd5b505050505050565b60095481565b60405160200180806020018281038252600b8152602001806a08498828696bea69a92a8960ab1b815250602001915050604051602081830303815290604052805190602001206110d38133611383565b611112576040805162461bcd60e51b815260206004820152600b60248201526a1055551217d1905253115160aa1b604482015290519081900360640190fd5b816103e8116111525760405162461bcd60e51b8152600401808060200182810382526023815260200180612bde6023913960400191505060405180910390fd5b60098290556040805183815290517f20461e09b8e557b77e107939f9ce6544698123aad0fc964ac5cc59b7df2e608f9181900360200190a15050565b60405160200180806020018281038252600b8152602001806a08498828696bea69a92a8960ab1b815250602001915050604051602081830303815290604052805190602001206111de8133611383565b61121d576040805162461bcd60e51b815260206004820152600b60248201526a1055551217d1905253115160aa1b604482015290519081900360640190fd5b826001600160a01b031663095ea7b385846040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561104b57600080fd5b60405160200180806020018281038252600b8152602001806a08498828696bea69a92a8960ab1b815250602001915050604051602081830303815290604052805190602001206112cd8133611383565b61130c576040805162461bcd60e51b815260206004820152600b60248201526a1055551217d1905253115160aa1b604482015290519081900360640190fd5b60068054831515610100810261ff00199092169190911790915560408051918252517f9cdfcfbda89131fca310e98b50c81c285ec0826fea03397cdd05d0666ccadfe69181900360200190a15050565b600082815260208190526040812061137a908363ffffffff6124ee16565b90505b92915050565b600082815260208190526040812061137a908363ffffffff6124fa16565b60035461010090046001600160a01b031681565b6004546001600160a01b031681565b60026020526000908152604090205481565b600654610100900460ff1661142a576040805162461bcd60e51b815260206004820152601560248201527419195c1bdcda5d0e881b9bdd08195b9858995b1959605a1b604482015290519081900360640190fd5b60048054604080516370a0823160e01b815233938101939093525183926001600160a01b03909216916370a08231916024808301926020929190829003018186803b15801561147857600080fd5b505afa15801561148c573d6000803e3d6000fd5b505050506040513d60208110156114a257600080fd5b505110156114eb576040805162461bcd60e51b81526020600482015260116024820152706e6f7420656e6f75676820746f6b656e7360781b604482015290519081900360640190fd5b80600754111561153a576040805162461bcd60e51b81526020600482015260156024820152743232b837b9b4ba1d1030b6b7bab73a101e1036b4b760591b604482015290519081900360640190fd5b3360009081526001602052604081205461155a908363ffffffff61250f16565b90506008548111156115ab576040805162461bcd60e51b81526020600482015260156024820152740c8cae0dee6d2e87440c2dadeeadce8407c40dac2f605b1b604482015290519081900360640190fd5b60055460048054604080516370a0823160e01b81523093810193909352516001600160a01b03909116916370a08231916024808301926020929190829003018186803b1580156115fa57600080fd5b505afa15801561160e573d6000803e3d6000fd5b505050506040513d602081101561162457600080fd5b50511115611663576040805162461bcd60e51b815260206004820152600760248201526604d41585f4341560cc1b604482015290519081900360640190fd5b60048054604080516323b872dd60e01b8152339381019390935230602484015260448301859052516001600160a01b03909116916323b872dd9160648083019260209291908290030181600087803b1580156116be57600080fd5b505af11580156116d2573d6000803e3d6000fd5b505050506040513d60208110156116e857600080fd5b50503360009081526001602052604090205461170a908363ffffffff61250f16565b3360008181526001602090815260409182902093909355805191825291810184905281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a15050565b6001600160a01b031660009081526001602052604090205490565b60065460ff166117c7576040805162461bcd60e51b81526020600482015260156024820152741dda5d1a191c985dce881b9bdd08195b98589b1959605a1b604482015290519081900360640190fd5b33600090815260016020526040902054821115611822576040805162461bcd60e51b815260206004820152601460248201527318985b185b98d9481a5b9cdd59999a58da595b9d60621b604482015290519081900360640190fd5b33600090815260016020526040902054611842908363ffffffff61256916565b3360009081526001602090815260408083209390935560048054845163a9059cbb60e01b81526001600160a01b038781169382019390935260248101889052945191169363a9059cbb9360448083019493928390030190829087803b1580156118aa57600080fd5b505af11580156118be573d6000803e3d6000fd5b505050506040513d60208110156118d457600080fd5b505060408051338152602081018490526001600160a01b0383168183015290517f51faa29987d414cc66998a6556a58b18659c063a7ed944d9a8439e54ba1844bf9181900360600190a15050565b60405160200180806020018281038252600b8152602001806a08498828696bea69a92a8960ab1b815250602001915050604051602081830303815290604052805190602001206119728133611383565b6119b1576040805162461bcd60e51b815260206004820152600b60248201526a1055551217d1905253115160aa1b604482015290519081900360640190fd5b814710156119fd576040805162461bcd60e51b815260206004820152601460248201527318985b185b98d9481a5b9cdd59999a58da595b9d60621b604482015290519081900360640190fd5b604051339083156108fc029084906000818181858888f19350505050158015611a2a573d6000803e3d6000fd5b505050565b600081815260208190526040812061137d906125c6565b600a5481565b600082815260208190526040902060020154611a6a90610bce61240c565b610d525760405162461bcd60e51b8152600401808060200182810382526030815260200180612bae6030913960400191505060405180910390fd5b60065460ff16611af4576040805162461bcd60e51b81526020600482015260156024820152741dda5d1a191c985dce881b9bdd08195b98589b1959605a1b604482015290519081900360640190fd5b6000611b3e612710611b32611b1660095461271061256990919063ffffffff16565b336000908152600260205260409020549063ffffffff6125d116565b9063ffffffff61262a16565b3360009081526002602052604081205491925090611b62908363ffffffff61256916565b3360009081526002602052604081205491925090611b86908363ffffffff61256916565b600354604080516370a0823160e01b8152306004820152905192935083926101009092046001600160a01b0316916370a0823191602480820192602092909190829003018186803b158015611bda57600080fd5b505afa158015611bee573d6000803e3d6000fd5b505050506040513d6020811015611c0457600080fd5b50511015611c50576040805162461bcd60e51b815260206004820152601460248201527318985b185b98d9481a5b9cdd59999a58da595b9d60621b604482015290519081900360640190fd5b6003546040805163a9059cbb60e01b81526001600160a01b0387811660048301526024820185905291516101009093049091169163a9059cbb916044808201926020929091908290030181600087803b158015611cac57600080fd5b505af1158015611cc0573d6000803e3d6000fd5b505050506040513d6020811015611cd657600080fd5b5050600a54611ceb908363ffffffff61250f16565b600a555050336000908152600260205260408120555050565b6103e881565b60405160200180806020018281038252600b8152602001806a08498828696bea69a92a8960ab1b8152506020019150506040516020818303038152906040528051906020012081565b60405160200180806020018281038252600b8152602001806a08498828696bea69a92a8960ab1b81525060200191505060405160208183030381529060405280519060200120611da38133611383565b611de2576040805162461bcd60e51b815260206004820152600b60248201526a1055551217d1905253115160aa1b604482015290519081900360640190fd5b82821115611e25576040805162461bcd60e51b815260206004820152600b60248201526a282924a1a2afa2a92927a960a91b604482015290519081900360640190fd5b85611e68576040805162461bcd60e51b815260206004820152600e60248201526d149150d15255915494d7d395531360921b604482015290519081900360640190fd5b6000805b878110156120cd576000600160008b8b85818110611e8657fe5b905060200201356001600160a01b03166001600160a01b03166001600160a01b0316815260200190815260200160002054905084831415611ec757506120cd565b84611ed8848363ffffffff61250f16565b11611ef457611eed838263ffffffff61250f16565b9250611f19565b611f04858463ffffffff61256916565b9050611f16838263ffffffff61250f16565b92505b611f6c81600160008d8d87818110611f2d57fe5b905060200201356001600160a01b03166001600160a01b03166001600160a01b031681526020019081526020016000205461256990919063ffffffff16565b600160008c8c86818110611f7c57fe5b905060200201356001600160a01b03166001600160a01b03166001600160a01b03168152602001908152602001600020819055506000611fc986611b32848b6125d190919063ffffffff16565b905061201e81600260008e8e88818110611fdf57fe5b905060200201356001600160a01b03166001600160a01b03166001600160a01b031681526020019081526020016000205461250f90919063ffffffff16565b600260008d8d8781811061202e57fe5b905060200201356001600160a01b03166001600160a01b03166001600160a01b03168152602001908152602001600020819055507f042d87d62eacb0057c5928341d8ef804029a33ed1c3c74c45665fc3bde3aef508b8b8581811061208f57fe5b604080516001600160a01b03602093840295909501359490941684529083018590528281018690525191829003606001919050a15050600101611e6c565b50828114612117576040805162461bcd60e51b8152602060048201526012602482015271494e53554646494349454e545f46554e445360701b604482015290519081900360640190fd5b6121218686612691565b5050505050505050565b60016020526000908152604090205481565b60405160200180806020018281038252600b8152602001806a08498828696bea69a92a8960ab1b8152506020019150506040516020818303038152906040528051906020012061218d8133611383565b6121cc576040805162461bcd60e51b815260206004820152600b60248201526a1055551217d1905253115160aa1b604482015290519081900360640190fd5b6006805483151560ff19909116811790915560408051918252517fe1b67976c7c5d3657a3a1f4d007966431f34c0a1a549fa186b3df287146d3bab9181900360200190a15050565b60405160200180806020018281038252600b8152602001806a08498828696bea69a92a8960ab1b815250602001915050604051602081830303815290604052805190602001206122648133611383565b6122a3576040805162461bcd60e51b815260206004820152600b60248201526a1055551217d1905253115160aa1b604482015290519081900360640190fd5b600a54600354604080516370a0823160e01b815230600482015290516101009092046001600160a01b0316916370a0823191602480820192602092909190829003018186803b1580156122f557600080fd5b505afa158015612309573d6000803e3d6000fd5b505050506040513d602081101561231f57600080fd5b5051101561236b576040805162461bcd60e51b815260206004820152601460248201527318985b185b98d9481a5b9cdd59999a58da595b9d60621b604482015290519081900360640190fd5b600354600a546040805163a9059cbb60e01b81523360048201526024810192909252516101009092046001600160a01b03169163a9059cbb916044808201926020929091908290030181600087803b1580156123c657600080fd5b505af11580156123da573d6000803e3d6000fd5b505050506040513d60208110156123f057600080fd5b50506000600a5550565b61271081565b61240981611aa5565b50565b3390565b600082815260208190526040902061242e908263ffffffff6129a216565b15610c185761243b61240c565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600082815260208190526040902061249d908263ffffffff6129b716565b15610c18576124aa61240c565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b600061137a83836129cc565b600061137a836001600160a01b038416612a30565b60008282018381101561137a576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000828211156125c0576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b600061137d82612a48565b6000826125e05750600061137d565b828202828482816125ed57fe5b041461137a5760405162461bcd60e51b8152600401808060200182810382526021815260200180612c016021913960400191505060405180910390fd5b6000808211612680576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b81838161268957fe5b049392505050565b606080836001600160a01b031663371babdc846040518263ffffffff1660e01b81526004018082815260200191505060006040518083038186803b1580156126d857600080fd5b505afa1580156126ec573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604090815281101561271557600080fd5b8101908080516040519392919084600160201b82111561273457600080fd5b90830190602082018581111561274957600080fd5b82518660208202830111600160201b8211171561276557600080fd5b82525081516020918201928201910280838360005b8381101561279257818101518382015260200161277a565b5050505090500160405260200180516040519392919084600160201b8211156127ba57600080fd5b9083019060208201858111156127cf57600080fd5b82518660208202830111600160201b821117156127eb57600080fd5b82525081516020918201928201910280838360005b83811015612818578181015183820152602001612800565b505050509050016040525050509150915060008090505b825181101561294257600083828151811061284657fe5b60200260200101519050600083838151811061285e57fe5b60200260200101519050600082905081816001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060206040518083038186803b1580156128c457600080fd5b505afa1580156128d8573d6000803e3d6000fd5b505050506040513d60208110156128ee57600080fd5b50511015612937576040805162461bcd60e51b81526020600482015260116024820152706e6f7420656e6f75676820746f6b656e7360781b604482015290519081900360640190fd5b50505060010161282f565b506000849050806001600160a01b0316633fe90675856040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561298e57600080fd5b505af1158015610b90573d6000803e3d6000fd5b600061137a836001600160a01b038416612a4c565b600061137a836001600160a01b038416612a96565b81546000908210612a0e5760405162461bcd60e51b8152600401808060200182810382526022815260200180612b5d6022913960400191505060405180910390fd5b826000018281548110612a1d57fe5b9060005260206000200154905092915050565b60009081526001919091016020526040902054151590565b5490565b6000612a588383612a30565b612a8e5750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561137d565b50600061137d565b60008181526001830160205260408120548015612b525783546000198083019190810190600090879083908110612ac957fe5b9060005260206000200154905080876000018481548110612ae657fe5b600091825260208083209091019290925582815260018981019092526040902090840190558654879080612b1657fe5b6001900381819060005260206000200160009055905586600101600087815260200190815260200160002060009055600194505050505061137d565b600091505061137d56fe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e6473416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f206772616e74416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f207265766f6b657365744665653a20464545206d75737420626520696e666572696f72206f6620313025536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636520726f6c657320666f722073656c66a2646970667358221220b7026676b40ee6e47b7e48e399f78a5c7e2f78054bacb6779fc372e0bd4c1f6764736f6c63430006040033
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.