Feature Tip: Add private address tag to any address under My Name Tag !
Source Code
Advanced mode:
| Parent Transaction Hash | Method | Block |
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
There are no matching entriesUpdate your filters to view other transactions | |||||||||
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
AssetsVault
Compiler Version
v0.8.21+commit.d9974bed
Optimization Enabled:
Yes with 10 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity 0.8.21;
import {TransferHelper} from "@uniswap/v3-periphery/contracts/libraries/TransferHelper.sol";
contract AssetsVault {
address public stoneVault;
address public strategyController;
modifier onlyPermit() {
require(
stoneVault == msg.sender || strategyController == msg.sender,
"not permit"
);
_;
}
constructor(address _stoneVault, address _strategyController) {
require(
_stoneVault != address(0) && _strategyController != address(0),
"ZERO ADDRESS"
);
stoneVault = _stoneVault;
strategyController = _strategyController;
}
function deposit() external payable {
require(msg.value != 0, "too small");
}
function withdraw(address _to, uint256 _amount) external onlyPermit {
TransferHelper.safeTransferETH(_to, _amount);
}
function setNewVault(address _vault) external onlyPermit {
stoneVault = _vault;
}
function getBalance() external view returns (uint256 amount) {
amount = address(this).balance;
}
receive() external payable {}
}// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.6.0;
import '@openzeppelin/contracts/token/ERC20/IERC20.sol';
library TransferHelper {
/// @notice Transfers tokens from the targeted address to the given destination
/// @notice Errors with 'STF' if transfer fails
/// @param token The contract address of the token to be transferred
/// @param from The originating address from which the tokens will be transferred
/// @param to The destination address of the transfer
/// @param value The amount to be transferred
function safeTransferFrom(
address token,
address from,
address to,
uint256 value
) internal {
(bool success, bytes memory data) =
token.call(abi.encodeWithSelector(IERC20.transferFrom.selector, from, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), 'STF');
}
/// @notice Transfers tokens from msg.sender to a recipient
/// @dev Errors with ST if transfer fails
/// @param token The contract address of the token which will be transferred
/// @param to The recipient of the transfer
/// @param value The value of the transfer
function safeTransfer(
address token,
address to,
uint256 value
) internal {
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(IERC20.transfer.selector, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), 'ST');
}
/// @notice Approves the stipulated contract to spend the given allowance in the given token
/// @dev Errors with 'SA' if transfer fails
/// @param token The contract address of the token to be approved
/// @param to The target of the approval
/// @param value The amount of the given token the target will be allowed to spend
function safeApprove(
address token,
address to,
uint256 value
) internal {
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(IERC20.approve.selector, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), 'SA');
}
/// @notice Transfers ETH to the recipient address
/// @dev Fails with `STE`
/// @param to The destination of the transfer
/// @param value The value to be transferred
function safeTransferETH(address to, uint256 value) internal {
(bool success, ) = to.call{value: value}(new bytes(0));
require(success, 'STE');
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @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);
/**
* @dev Returns the value of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the value of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 value) 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 a `value` amount of tokens 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 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the
* allowance mechanism. `value` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 value) external returns (bool);
}{
"optimizer": {
"enabled": true,
"runs": 10
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_stoneVault","type":"address"},{"internalType":"address","name":"_strategyController","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"deposit","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"getBalance","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_vault","type":"address"}],"name":"setNewVault","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stoneVault","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"strategyController","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]Contract Creation Code
608060405234801561000f575f80fd5b506040516104ad3803806104ad83398101604081905261002e916100d8565b6001600160a01b0382161580159061004e57506001600160a01b03811615155b61008d5760405162461bcd60e51b815260206004820152600c60248201526b5a45524f204144445245535360a01b604482015260640160405180910390fd5b5f80546001600160a01b039384166001600160a01b03199182161790915560018054929093169116179055610109565b80516001600160a01b03811681146100d3575f80fd5b919050565b5f80604083850312156100e9575f80fd5b6100f2836100bd565b9150610100602084016100bd565b90509250929050565b610397806101165f395ff3fe608060405260043610610056575f3560e01c8062258d6b1461006157806312065fe01461009d578063ba93ec29146100b7578063d0e30db0146100d5578063e7b77f70146100df578063f3fef3a3146100fe575f80fd5b3661005d57005b5f80fd5b34801561006c575f80fd5b50600154610080906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156100a8575f80fd5b50604051478152602001610094565b3480156100c2575f80fd5b505f54610080906001600160a01b031681565b6100dd61011d565b005b3480156100ea575f80fd5b506100dd6100f93660046102c9565b61015f565b348015610109575f80fd5b506100dd6101183660046102e9565b6101be565b345f0361015d5760405162461bcd60e51b81526020600482015260096024820152681d1bdbc81cdb585b1b60ba1b60448201526064015b60405180910390fd5b565b5f546001600160a01b031633148061018157506001546001600160a01b031633145b61019d5760405162461bcd60e51b815260040161015490610311565b5f80546001600160a01b0319166001600160a01b0392909216919091179055565b5f546001600160a01b03163314806101e057506001546001600160a01b031633145b6101fc5760405162461bcd60e51b815260040161015490610311565b610206828261020a565b5050565b604080515f808252602082019092526001600160a01b0384169083906040516102339190610335565b5f6040518083038185875af1925050503d805f811461026d576040519150601f19603f3d011682016040523d82523d5f602084013e610272565b606091505b50509050806102a95760405162461bcd60e51b815260206004820152600360248201526253544560e81b6044820152606401610154565b505050565b80356001600160a01b03811681146102c4575f80fd5b919050565b5f602082840312156102d9575f80fd5b6102e2826102ae565b9392505050565b5f80604083850312156102fa575f80fd5b610303836102ae565b946020939093013593505050565b6020808252600a90820152691b9bdd081c195c9b5a5d60b21b604082015260600190565b5f82515f5b81811015610354576020818601810151858301520161033a565b505f92019182525091905056fea26469706673582212206521a7c2deab2358a2bd329e7d1d5e591b0146b8dfb7ccf3eab70a9e3e8a902c64736f6c63430008150033000000000000000000000000a62f9c5af106feee069f38de51098d9d81b90572000000000000000000000000396abf9ff46e21694f4ef01ca77c6d7893a017b2
Deployed Bytecode
0x608060405260043610610056575f3560e01c8062258d6b1461006157806312065fe01461009d578063ba93ec29146100b7578063d0e30db0146100d5578063e7b77f70146100df578063f3fef3a3146100fe575f80fd5b3661005d57005b5f80fd5b34801561006c575f80fd5b50600154610080906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156100a8575f80fd5b50604051478152602001610094565b3480156100c2575f80fd5b505f54610080906001600160a01b031681565b6100dd61011d565b005b3480156100ea575f80fd5b506100dd6100f93660046102c9565b61015f565b348015610109575f80fd5b506100dd6101183660046102e9565b6101be565b345f0361015d5760405162461bcd60e51b81526020600482015260096024820152681d1bdbc81cdb585b1b60ba1b60448201526064015b60405180910390fd5b565b5f546001600160a01b031633148061018157506001546001600160a01b031633145b61019d5760405162461bcd60e51b815260040161015490610311565b5f80546001600160a01b0319166001600160a01b0392909216919091179055565b5f546001600160a01b03163314806101e057506001546001600160a01b031633145b6101fc5760405162461bcd60e51b815260040161015490610311565b610206828261020a565b5050565b604080515f808252602082019092526001600160a01b0384169083906040516102339190610335565b5f6040518083038185875af1925050503d805f811461026d576040519150601f19603f3d011682016040523d82523d5f602084013e610272565b606091505b50509050806102a95760405162461bcd60e51b815260206004820152600360248201526253544560e81b6044820152606401610154565b505050565b80356001600160a01b03811681146102c4575f80fd5b919050565b5f602082840312156102d9575f80fd5b6102e2826102ae565b9392505050565b5f80604083850312156102fa575f80fd5b610303836102ae565b946020939093013593505050565b6020808252600a90820152691b9bdd081c195c9b5a5d60b21b604082015260600190565b5f82515f5b81811015610354576020818601810151858301520161033a565b505f92019182525091905056fea26469706673582212206521a7c2deab2358a2bd329e7d1d5e591b0146b8dfb7ccf3eab70a9e3e8a902c64736f6c63430008150033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000a62f9c5af106feee069f38de51098d9d81b90572000000000000000000000000396abf9ff46e21694f4ef01ca77c6d7893a017b2
-----Decoded View---------------
Arg [0] : _stoneVault (address): 0xA62F9C5af106FeEE069F38dE51098D9d81B90572
Arg [1] : _strategyController (address): 0x396aBF9fF46E21694F4eF01ca77C6d7893A017B2
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000a62f9c5af106feee069f38de51098d9d81b90572
Arg [1] : 000000000000000000000000396abf9ff46e21694f4ef01ca77c6d7893a017b2
Loading...
Loading
Loading...
Loading
Loading...
Loading
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.