Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00Latest 6 from a total of 6 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Spread Asset | 16754386 | 1095 days ago | IN | 0.01 ETH | 0.00070665 | ||||
| Save Asset | 16754363 | 1095 days ago | IN | 0 ETH | 0.00057951 | ||||
| Spread Asset | 16754347 | 1095 days ago | IN | 0.01 ETH | 0.00048109 | ||||
| Spread Asset | 16715247 | 1101 days ago | IN | 0.005 ETH | 0.00152315 | ||||
| Spread ERC20Simp... | 15681846 | 1245 days ago | IN | 0 ETH | 0.00049502 | ||||
| Spread ERC20Simp... | 15681786 | 1245 days ago | IN | 0 ETH | 0.00191805 |
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
Spread
Compiler Version
v0.8.12+commit.f00d7308
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.8.12;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
/// @title Spread Dapp, Edition Ethereum.
/// @author @dadogg80, Viken Blockchain Solutions.
/// @notice Transfer your cryptocurrency to multiple accounts in one transaction.
/// @dev The purpose of this smart-contract was to create an updated dapp
/// of what is already available on the blockchain network.
contract Spread is Ownable {
/// @dev authentication error.
error Error_1();
/// @dev thrown by receive function.
error Error_2();
/// @dev thrown if zero values.
error ZeroValues();
constructor() {
}
modifier noZeroValues(address[] calldata recipients, uint256[] calldata values) {
if (recipients.length <= 0 || values.length <= 0) revert ZeroValues();
_;
}
/// @dev Receive function.
receive() external payable {
revert Error_2();
}
/// This will allow you to batch transfers of an mainnet asset like Ethereum, Matic, etc, to multiple accounts.
/// @param recipients List with the recipient accounts.
/// @param values List with the values to transfer to the corresponding recipient.
/// @dev Address example: ["address","address","address"].
/// @dev Value example: ["value","value","value"].
function spreadAsset(address[] calldata recipients, uint256[] calldata values) external payable noZeroValues(recipients, values) {
for (uint256 i = 0; i < recipients.length; i++)
payable(recipients[i]).transfer(values[i]);
}
/// This will allow you to batch transfers of erc20 tokens, to multiple accounts.
/// @param token The ERC20 contract address
/// @param recipients List with the recipient accounts.
/// @param values List with values to transfer to the corresponding recipient.
/// @dev Address example: ["address","address","address"].
/// @dev Value example: [value,value,value].
function spreadERC20(IERC20 token, address[] calldata recipients, uint256[] calldata values) external noZeroValues(recipients, values) {
uint256 total = 0;
for (uint256 i = 0; i < recipients.length; i++)
total += values[i];
require(token.transferFrom(msg.sender, address(this), total));
for (uint256 i = 0; i < recipients.length; i++)
require(token.transfer(recipients[i], values[i]));
}
/// This is a cheaper way to batch transfer erc20 tokens, to multiple accounts.
/// @param token The ERC20 contract address
/// @param recipients List with the recipient accounts.
/// @param values List with values to transfer to the corresponding recipient.
/// @dev Address example: ["address","address","address"].
/// @dev Value example: [value, value, value].
function spreadERC20Simple(IERC20 token, address[] calldata recipients, uint256[] calldata values) external noZeroValues(recipients, values) {
for (uint256 i = 0; i < recipients.length; i++)
require(token.transferFrom(msg.sender, recipients[i], values[i]));
}
/// This will allow the owner account to save any stuck erc20 tokens.
/// @param token The ERC20 contract address.
/// @dev Restricted by onlyOwner modifier.
function saveERC20(IERC20 token) external onlyOwner {
uint256 amount = token.balanceOf(address(this));
require(token.transfer(address(msg.sender), amount));
}
/// This will allow the owner account to save any stuck main asset.
/// @dev Restricted by onlyOwner modifier.
function saveAsset() external onlyOwner {
uint256 asset = address(this).balance;
payable(msg.sender).transfer(asset);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol)
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);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @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() {
_transferOwnership(_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 {
_transferOwnership(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");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
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;
}
}{
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"Error_1","type":"error"},{"inputs":[],"name":"Error_2","type":"error"},{"inputs":[],"name":"ZeroValues","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"saveAsset","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"}],"name":"saveERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"recipients","type":"address[]"},{"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"spreadAsset","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"address[]","name":"recipients","type":"address[]"},{"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"spreadERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"address[]","name":"recipients","type":"address[]"},{"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"spreadERC20Simple","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]Contract Creation Code
608060405234801561001057600080fd5b5061001a3361001f565b61006f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b610a798061007e6000396000f3fe60806040526004361061007f5760003560e01c8063dfdebec61161004e578063dfdebec614610125578063e206a8d814610138578063e71a8e0b14610158578063f2fde38b1461016d57600080fd5b8063354fcdea146100a2578063715018a6146100c457806384396e84146100d95780638da5cb5b146100f957600080fd5b3661009d5760405163df36e2c760e01b815260040160405180910390fd5b600080fd5b3480156100ae57600080fd5b506100c26100bd366004610861565b61018d565b005b3480156100d057600080fd5b506100c26102b5565b3480156100e557600080fd5b506100c26100f4366004610861565b6102f4565b34801561010557600080fd5b50600054604080516001600160a01b039092168252519081900360200190f35b6100c26101333660046108e4565b6104d9565b34801561014457600080fd5b506100c2610153366004610950565b6105a6565b34801561016457600080fd5b506100c26106bc565b34801561017957600080fd5b506100c2610188366004610950565b610715565b8383838382158061019c575080155b156101ba5760405163a97c1f7760e01b815260040160405180910390fd5b60005b878110156102a957896001600160a01b03166323b872dd338b8b858181106101e7576101e7610974565b90506020020160208101906101fc9190610950565b8a8a8681811061020e5761020e610974565b6040516001600160e01b031960e088901b1681526001600160a01b039586166004820152949093166024850152506020909102013560448201526064016020604051808303816000875af115801561026a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061028e919061098a565b61029757600080fd5b806102a1816109c2565b9150506101bd565b50505050505050505050565b6000546001600160a01b031633146102e85760405162461bcd60e51b81526004016102df906109dd565b60405180910390fd5b6102f260006107b0565b565b83838383821580610303575080155b156103215760405163a97c1f7760e01b815260040160405180910390fd5b6000805b888110156103655787878281811061033f5761033f610974565b90506020020135826103519190610a12565b91508061035d816109c2565b915050610325565b506040516323b872dd60e01b8152336004820152306024820152604481018290526001600160a01b038b16906323b872dd906064016020604051808303816000875af11580156103b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103dd919061098a565b6103e657600080fd5b60005b888110156104cc578a6001600160a01b031663a9059cbb8b8b8481811061041257610412610974565b90506020020160208101906104279190610950565b8a8a8581811061043957610439610974565b6040516001600160e01b031960e087901b1681526001600160a01b03909416600485015260200291909101356024830152506044016020604051808303816000875af115801561048d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104b1919061098a565b6104ba57600080fd5b806104c4816109c2565b9150506103e9565b5050505050505050505050565b838383838215806104e8575080155b156105065760405163a97c1f7760e01b815260040160405180910390fd5b60005b8781101561059b5788888281811061052357610523610974565b90506020020160208101906105389190610950565b6001600160a01b03166108fc88888481811061055657610556610974565b905060200201359081150290604051600060405180830381858888f19350505050158015610588573d6000803e3d6000fd5b5080610593816109c2565b915050610509565b505050505050505050565b6000546001600160a01b031633146105d05760405162461bcd60e51b81526004016102df906109dd565b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa158015610617573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061063b9190610a2a565b60405163a9059cbb60e01b8152336004820152602481018290529091506001600160a01b0383169063a9059cbb906044016020604051808303816000875af115801561068b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106af919061098a565b6106b857600080fd5b5050565b6000546001600160a01b031633146106e65760405162461bcd60e51b81526004016102df906109dd565b6040514790339082156108fc029083906000818181858888f193505050501580156106b8573d6000803e3d6000fd5b6000546001600160a01b0316331461073f5760405162461bcd60e51b81526004016102df906109dd565b6001600160a01b0381166107a45760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016102df565b6107ad816107b0565b50565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146107ad57600080fd5b60008083601f84011261082757600080fd5b50813567ffffffffffffffff81111561083f57600080fd5b6020830191508360208260051b850101111561085a57600080fd5b9250929050565b60008060008060006060868803121561087957600080fd5b853561088481610800565b9450602086013567ffffffffffffffff808211156108a157600080fd5b6108ad89838a01610815565b909650945060408801359150808211156108c657600080fd5b506108d388828901610815565b969995985093965092949392505050565b600080600080604085870312156108fa57600080fd5b843567ffffffffffffffff8082111561091257600080fd5b61091e88838901610815565b9096509450602087013591508082111561093757600080fd5b5061094487828801610815565b95989497509550505050565b60006020828403121561096257600080fd5b813561096d81610800565b9392505050565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561099c57600080fd5b8151801515811461096d57600080fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156109d6576109d66109ac565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60008219821115610a2557610a256109ac565b500190565b600060208284031215610a3c57600080fd5b505191905056fea2646970667358221220f8ac11e1788a2a54360627f494ee08fd2e58fe7aa091bcff03466931cf228e8a64736f6c634300080c0033
Deployed Bytecode
0x60806040526004361061007f5760003560e01c8063dfdebec61161004e578063dfdebec614610125578063e206a8d814610138578063e71a8e0b14610158578063f2fde38b1461016d57600080fd5b8063354fcdea146100a2578063715018a6146100c457806384396e84146100d95780638da5cb5b146100f957600080fd5b3661009d5760405163df36e2c760e01b815260040160405180910390fd5b600080fd5b3480156100ae57600080fd5b506100c26100bd366004610861565b61018d565b005b3480156100d057600080fd5b506100c26102b5565b3480156100e557600080fd5b506100c26100f4366004610861565b6102f4565b34801561010557600080fd5b50600054604080516001600160a01b039092168252519081900360200190f35b6100c26101333660046108e4565b6104d9565b34801561014457600080fd5b506100c2610153366004610950565b6105a6565b34801561016457600080fd5b506100c26106bc565b34801561017957600080fd5b506100c2610188366004610950565b610715565b8383838382158061019c575080155b156101ba5760405163a97c1f7760e01b815260040160405180910390fd5b60005b878110156102a957896001600160a01b03166323b872dd338b8b858181106101e7576101e7610974565b90506020020160208101906101fc9190610950565b8a8a8681811061020e5761020e610974565b6040516001600160e01b031960e088901b1681526001600160a01b039586166004820152949093166024850152506020909102013560448201526064016020604051808303816000875af115801561026a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061028e919061098a565b61029757600080fd5b806102a1816109c2565b9150506101bd565b50505050505050505050565b6000546001600160a01b031633146102e85760405162461bcd60e51b81526004016102df906109dd565b60405180910390fd5b6102f260006107b0565b565b83838383821580610303575080155b156103215760405163a97c1f7760e01b815260040160405180910390fd5b6000805b888110156103655787878281811061033f5761033f610974565b90506020020135826103519190610a12565b91508061035d816109c2565b915050610325565b506040516323b872dd60e01b8152336004820152306024820152604481018290526001600160a01b038b16906323b872dd906064016020604051808303816000875af11580156103b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103dd919061098a565b6103e657600080fd5b60005b888110156104cc578a6001600160a01b031663a9059cbb8b8b8481811061041257610412610974565b90506020020160208101906104279190610950565b8a8a8581811061043957610439610974565b6040516001600160e01b031960e087901b1681526001600160a01b03909416600485015260200291909101356024830152506044016020604051808303816000875af115801561048d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104b1919061098a565b6104ba57600080fd5b806104c4816109c2565b9150506103e9565b5050505050505050505050565b838383838215806104e8575080155b156105065760405163a97c1f7760e01b815260040160405180910390fd5b60005b8781101561059b5788888281811061052357610523610974565b90506020020160208101906105389190610950565b6001600160a01b03166108fc88888481811061055657610556610974565b905060200201359081150290604051600060405180830381858888f19350505050158015610588573d6000803e3d6000fd5b5080610593816109c2565b915050610509565b505050505050505050565b6000546001600160a01b031633146105d05760405162461bcd60e51b81526004016102df906109dd565b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa158015610617573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061063b9190610a2a565b60405163a9059cbb60e01b8152336004820152602481018290529091506001600160a01b0383169063a9059cbb906044016020604051808303816000875af115801561068b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106af919061098a565b6106b857600080fd5b5050565b6000546001600160a01b031633146106e65760405162461bcd60e51b81526004016102df906109dd565b6040514790339082156108fc029083906000818181858888f193505050501580156106b8573d6000803e3d6000fd5b6000546001600160a01b0316331461073f5760405162461bcd60e51b81526004016102df906109dd565b6001600160a01b0381166107a45760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016102df565b6107ad816107b0565b50565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146107ad57600080fd5b60008083601f84011261082757600080fd5b50813567ffffffffffffffff81111561083f57600080fd5b6020830191508360208260051b850101111561085a57600080fd5b9250929050565b60008060008060006060868803121561087957600080fd5b853561088481610800565b9450602086013567ffffffffffffffff808211156108a157600080fd5b6108ad89838a01610815565b909650945060408801359150808211156108c657600080fd5b506108d388828901610815565b969995985093965092949392505050565b600080600080604085870312156108fa57600080fd5b843567ffffffffffffffff8082111561091257600080fd5b61091e88838901610815565b9096509450602087013591508082111561093757600080fd5b5061094487828801610815565b95989497509550505050565b60006020828403121561096257600080fd5b813561096d81610800565b9392505050565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561099c57600080fd5b8151801515811461096d57600080fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156109d6576109d66109ac565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60008219821115610a2557610a256109ac565b500190565b600060208284031215610a3c57600080fd5b505191905056fea2646970667358221220f8ac11e1788a2a54360627f494ee08fd2e58fe7aa091bcff03466931cf228e8a64736f6c634300080c0033
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 33 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ 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.