Polygon Sponsored slots available. Book your slot here!
Contract Overview
Balance:
0 MATIC
MATIC Value:
$0.00
My Name Tag:
Not Available, login to update
[ Download CSV Export ]
Latest 1 internal transaction
Parent Txn Hash | Block | From | To | Value | |||
---|---|---|---|---|---|---|---|
0xd12966ddba989f0e36783e4592e4302b4306fd2091c8163eefa3bee6708ae0d8 | 28762667 | 304 days 23 hrs ago | 0x36598d25fdc8f262d25e4ad321421085c0ab7789 | Contract Creation | 0 MATIC |
[ Download CSV Export ]
Similar Match Source Code
Note: This contract matches the deployed ByteCode of the Source Code for Contract 0x40942542C4B164925D141803df189AdE770CF0Bf
Contract Name:
Stakes
Compiler Version
v0.8.4+commit.c7e474f2
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT /** MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMMMMMMMMMMMMWWWWWWWWWWWWWWWMMMMMMMMMMMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMMMMMMWWNXXKKKKKKKXXXXKKKKKKXXNWWMMMMMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMMWNXKKKKXXNWWWWMMWWWWMWWWWNXXXKKKXNWMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMWNXKKKXNWMMMMMMMMMNOdxKWMMMMMMMMWNXKKKXNWMMMMMMMMMMMMMM MMMMMMMMMMMMMWXKKKNWMMMMMMMMMMMMNx:;;l0WMMMMMMMMMMMWNK0KXWMMMMMMMMMMMM MMMMMMMMMMMWXKKXWMMMMMMMMMMMMMMXd:;;;;cOWMMMMMMMMMMMMMWXKKXWMMMMMMMMMM MMMMMMMMMWNKKXWMMMMMMMMMMMMMMWKo;;col:;:kNMMMMMMMMMMMMMMWX0KNWMMMMMMMM MMMMMMMMWX0XWMMMMMMMMMMMMMMMWOl;;oKWXkc;:dXMMMMMMMMMMMMMMMWX0XWMMMMMMM MMMMMMMNKKNWMMMMMMMMMMMMMMMNkc;:dXMMMWOc;;oKWMMMMMMMMMMMMMMWNKKNMMMMMM MMMMMMNKKNMMMMMMMMMMMMMMMMNx:;:xNMMMMMW0l;;l0WMMMMMMMWMMMMMMMNKKNMMMMM MMMMMNKKNMMMMMMMMMMMMMMMMXd:;ckNMMMMMMMMKo:;cOWMMMMXkxkXWMMMMMNKKNMMMM MMMMWK0NMMMMMMMMMMMMMMMWKo;;l0WMMMMMMMMMMXx:;:xNMMW0lccxXMMMMMMN0KWMMM MMMMX0XWMMMMMMWWMMMMMMWOl;;oKWMMMMMMMMMMMMNkc;:dXMMNklcoKMMMMMMMX0XMMM MMMWKKNMMWK0OkkkkkkKWNkc;:dXMMMMMMMMMMMMMMMWOl;;oKWMXdcxNMMMMMMMNKKWMM MMMN0XWMMWNXX0OdlccdKOc;:xNMMMWXKKXNWNNNNWWMW0o;;l0WNkdKWMMMMMMMWX0NMM MMMX0XMMMMMMMMMN0dlcdOxoONMMMMW0xdddddodxk0KNWXd:;l0Kx0WMMMMMMMMMX0XMM MMMX0NMMMMMMMMMMWXxlcoOXWMMMMWKkolclodkKNNNNWWMNxcxOkKWMMMMMMMMMMX0XMM MMMX0XMMMMMMMMMMMMNklclkNMMWXklccodxdodKWMMMMMMMNKOkKWMMMMMMMMMMMX0XMM MMMN0XWMMMMMMMMMMMMNOoclxXN0occcdKX0xlco0WMMMMMMNOOXMMMMMMMMMMMMMX0NMM MMMWKKWMMMMMMMMMMMMMW0dccoxocccdKWMWNklclONMMMMXOONMMMMMMMMMMMMMWKKWMM MMMMX0XMMMMMMMMMMMMMMWKdcccccco0WMMMMNOoclkNWWKk0NMMMMMMMMMMMMMMX0XWMM MMMMWKKNMMMMMMMMMMMMMMMXxlcccckNMMMMMMW0oclxK0kKWMMMMMMMMMMMMMMNKKWMMM MMMMMN0KWMMMMMMMMMMMMMMMNklccoKWMMMMMMMWKdlcoxKWMMMMMMMMMMMMMMWK0NMMMM MMMMMMN0KWMMMMMMMMMMMMMMMNOod0KXWMMMMMMNK0xoxXWMMMMMMMMMMMMMMWK0NMMMMM MMMMMMMN0KNMMMMMMMMMMMMMMMWXKkll0WMMMMXdcoOKNMMMMMMMMMMMMMMMNK0NMMMMMM MMMMMMMMNK0XWMMMMMMMMMMMMMMMNd:;cOWMWKo:;c0WMMMMMMMMMMMMMMWX0KNMMMMMMM MMMMMMMMMWXKKNWMMMMMMMMMMMMMMXd:;cx0kl;;l0WMMMMMMMMMMMMMWNKKXWMMMMMMMM MMMMMMMMMMMWX0KNWMMMMMMMMMMMMMNkc;;::;:oKWMMMMMMMMMMMMWNK0XWMMMMMMMMMM MMMMMMMMMMMMMNXKKXNWMMMMMMMMMMMWOc;;;:dXMMMMMMMMMMMWNXKKXWMMMMMMMMMMMM MMMMMMMMMMMMMMMWNKKKXNWMMMMMMMMMW0l:ckNMMMMMMMMMWNXKKKNWMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMMWNXKKKXXNWWWMMMMX0KWMMMWWWNXXKKKXNWMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMMMMMWWNXXKKKKKXXXXXXXXXXKKKKXXNWWMMMMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMMMMMMMMMMMWWNNNNNNNNNNNNWWWMMMMMMMMMMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM ---------------------- [ WPSmartContracts.com ] ---------------------- [ Blockchain Made Easy ] | | Stakes v.3 | |---------------------------- | | Flavor | | > Ube: Fully featured ERC-20 Staking contract with maturity time | and an annual interest | */ pragma solidity ^0.8.2; /** * @title Owner * @dev Set & change owner */ contract Owner { address private owner; // event for EVM logging event OwnerSet(address indexed oldOwner, address indexed newOwner); // modifier to check if caller is owner modifier isOwner() { // If the first argument of 'require' evaluates to 'false', execution terminates and all // changes to the state and to Ether balances are reverted. // This used to consume all gas in old EVM versions, but not anymore. // It is often a good idea to use 'require' to check if functions are called correctly. // As a second argument, you can also provide an explanation about what went wrong. require(msg.sender == owner, "Caller is not owner"); _; } /** * @dev Set contract deployer as owner */ constructor(address _owner) { owner = _owner; emit OwnerSet(address(0), owner); } /** * @dev Change owner * @param newOwner address of new owner */ function changeOwner(address newOwner) public isOwner { emit OwnerSet(owner, newOwner); owner = newOwner; } /** * @dev Return owner address * @return address of owner */ function getOwner() public view returns (address) { return owner; } } /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } } /** * @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); } /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); } /** * @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; } } /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin Contracts guidelines: functions revert * instead returning `false` on failure. This behavior is nonetheless * conventional and does not conflict with the expectations of ERC20 * applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20, IERC20Metadata { mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * The default value of {decimals} is 18. To select a different value for * {decimals} you should overload it. * * All two of these values are immutable: they can only be set once during * construction. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5.05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless this function is * overridden; * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual override returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * Requirements: * * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for ``sender``'s tokens of at least * `amount`. */ function transferFrom( address sender, address recipient, uint256 amount ) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); unchecked { _approve(sender, _msgSender(), currentAllowance - amount); } return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); unchecked { _approve(_msgSender(), spender, currentAllowance - subtractedValue); } return true; } /** * @dev Moves `amount` of tokens from `sender` to `recipient`. * * This internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer( address sender, address recipient, uint256 amount ) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[sender] = senderBalance - amount; } _balances[recipient] += amount; emit Transfer(sender, recipient, amount); _afterTokenTransfer(sender, recipient, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); _afterTokenTransfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); unchecked { _balances[account] = accountBalance - amount; } _totalSupply -= amount; emit Transfer(account, address(0), amount); _afterTokenTransfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve( address owner, address spender, uint256 amount ) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * has been transferred to `to`. * - when `from` is zero, `amount` tokens have been minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens have been burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 amount ) internal virtual {} } /** * * Stakes is an interest gain contract for ERC-20 tokens * * assets is the ERC20 token * interest_rate: percentage rate * maturity is the time in seconds after which is safe to end the stake * penalization for ending a stake before maturity time * lower_amount is the minimum amount for creating a stake * */ contract Stakes is Owner, ReentrancyGuard { // token ERC20 public asset; // stakes history struct Record { uint256 from; uint256 amount; uint256 gain; uint256 penalization; uint256 to; bool ended; } // contract parameters uint16 public interest_rate; uint256 public maturity; uint8 public penalization; uint256 public lower_amount; mapping(address => Record[]) public ledger; event StakeStart(address indexed user, uint256 value, uint256 index); event StakeEnd(address indexed user, uint256 value, uint256 penalty, uint256 interest, uint256 index); constructor(ERC20 _erc20, address _owner, uint16 _rate, uint256 _maturity, uint8 _penalization, uint256 _lower) Owner(_owner) { require(_penalization<=100, "Penalty has to be an integer between 0 and 100"); asset = _erc20; interest_rate = _rate; maturity = _maturity; penalization = _penalization; lower_amount = _lower; } function start(uint256 _value) external nonReentrant { require(_value >= lower_amount, "Invalid value"); require(asset.transferFrom(msg.sender, address(this), _value)); ledger[msg.sender].push(Record(block.timestamp, _value, 0, 0, 0, false)); emit StakeStart(msg.sender, _value, ledger[msg.sender].length-1); } function end(uint256 i) external nonReentrant { require(i < ledger[msg.sender].length, "Invalid index"); require(ledger[msg.sender][i].ended==false, "Invalid stake"); // penalization if(block.timestamp - ledger[msg.sender][i].from < maturity) { uint256 _penalization = ledger[msg.sender][i].amount * penalization / 100; require(asset.transfer(msg.sender, ledger[msg.sender][i].amount - _penalization)); require(asset.transfer(getOwner(), _penalization)); ledger[msg.sender][i].penalization = _penalization; ledger[msg.sender][i].to = block.timestamp; ledger[msg.sender][i].ended = true; emit StakeEnd(msg.sender, ledger[msg.sender][i].amount, _penalization, 0, i); // interest gained } else { uint256 _interest = get_gains(msg.sender, i); // check that the owner can pay interest before trying to pay if (asset.allowance(getOwner(), address(this)) >= _interest && asset.balanceOf(getOwner()) >= _interest) { require(asset.transferFrom(getOwner(), msg.sender, _interest)); } else { _interest = 0; } require(asset.transfer(msg.sender, ledger[msg.sender][i].amount)); ledger[msg.sender][i].gain = _interest; ledger[msg.sender][i].to = block.timestamp; ledger[msg.sender][i].ended = true; emit StakeEnd(msg.sender, ledger[msg.sender][i].amount, 0, _interest, i); } } function set(uint256 _lower, uint256 _maturity, uint16 _rate, uint8 _penalization) external isOwner { require(_penalization<=100, "Invalid value"); lower_amount = _lower; maturity = _maturity; interest_rate = _rate; penalization = _penalization; } // calculate interest to the current date time function get_gains(address _address, uint256 _rec_number) public view returns (uint256) { uint256 _record_seconds = block.timestamp - ledger[_address][_rec_number].from; uint256 _year_seconds = 365*24*60*60; return _record_seconds * ledger[_address][_rec_number].amount * interest_rate / 100 / _year_seconds; } function ledger_length(address _address) external view returns (uint256) { return ledger[_address].length; } }
{ "evmVersion": "istanbul", "libraries": {}, "metadata": { "bytecodeHash": "ipfs", "useLiteralContent": true }, "optimizer": { "enabled": true, "runs": 200 }, "remappings": [], "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"contract ERC20","name":"_erc20","type":"address"},{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint16","name":"_rate","type":"uint16"},{"internalType":"uint256","name":"_maturity","type":"uint256"},{"internalType":"uint8","name":"_penalization","type":"uint8"},{"internalType":"uint256","name":"_lower","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"penalty","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"interest","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"index","type":"uint256"}],"name":"StakeEnd","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"index","type":"uint256"}],"name":"StakeStart","type":"event"},{"inputs":[],"name":"asset","outputs":[{"internalType":"contract ERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"changeOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"i","type":"uint256"}],"name":"end","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"},{"internalType":"uint256","name":"_rec_number","type":"uint256"}],"name":"get_gains","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"interest_rate","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"ledger","outputs":[{"internalType":"uint256","name":"from","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"gain","type":"uint256"},{"internalType":"uint256","name":"penalization","type":"uint256"},{"internalType":"uint256","name":"to","type":"uint256"},{"internalType":"bool","name":"ended","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"ledger_length","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lower_amount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maturity","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"penalization","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_lower","type":"uint256"},{"internalType":"uint256","name":"_maturity","type":"uint256"},{"internalType":"uint16","name":"_rate","type":"uint16"},{"internalType":"uint8","name":"_penalization","type":"uint8"}],"name":"set","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"start","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b50604051620014123803806200141283398101604081905261003191610141565b600080546001600160a01b0319166001600160a01b03871690811782556040518792907f342827c97908e5e2f71151c08502a66d44b6f758e3ac2f1de95f02eb95f0a735908290a35060018055606460ff831611156100ed5760405162461bcd60e51b815260206004820152602e60248201527f50656e616c74792068617320746f20626520616e20696e74656765722062657460448201526d07765656e203020616e64203130360941b606482015260840160405180910390fd5b6002805461ffff909516600160a01b026001600160b01b03199095166001600160a01b0390971696909617939093179094556003556004805460ff90941660ff1990941693909317909255506005556101d6565b60008060008060008060c08789031215610159578182fd5b8651610164816101be565b6020880151909650610175816101be565b604088015190955061ffff8116811461018c578283fd5b60608801516080890151919550935060ff811681146101a9578283fd5b8092505060a087015190509295509295509295565b6001600160a01b03811681146101d357600080fd5b50565b61122c80620001e66000396000f3fe608060405234801561001057600080fd5b50600436106100cf5760003560e01c806374f1ca3a1161008c578063a6f9dae111610066578063a6f9dae1146101d1578063aa4c0dd9146101e4578063b7f8f9ea1461020d578063cbb3d8081461022057600080fd5b806374f1ca3a1461016b578063893d20e8146101ad57806395805dad146101be57600080fd5b80630ad24528146100d45780630c98c9c1146100e957806314145b4814610105578063204f83f91461011857806338d52e0f1461012157806357ca87401461014c575b600080fd5b6100e76100e2366004611106565b610248565b005b6100f260055481565b6040519081526020015b60405180910390f35b6100e7610113366004611136565b610bab565b6100f260035481565b600254610134906001600160a01b031681565b6040516001600160a01b0390911681526020016100fc565b6004546101599060ff1681565b60405160ff90911681526020016100fc565b61017e6101793660046110bd565b610c81565b6040805196875260208701959095529385019290925260608401526080830152151560a082015260c0016100fc565b6000546001600160a01b0316610134565b6100e76101cc366004611106565b610cd8565b6100e76101df36600461109c565b610ee3565b6100f26101f236600461109c565b6001600160a01b031660009081526006602052604090205490565b6100f261021b3660046110bd565b610f8e565b60025461023590600160a01b900461ffff1681565b60405161ffff90911681526020016100fc565b600260015414156102a05760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b60026001553360009081526006602052604090205481106102f35760405162461bcd60e51b815260206004820152600d60248201526c092dcecc2d8d2c840d2dcc8caf609b1b6044820152606401610297565b33600090815260066020526040902080548290811061032257634e487b7160e01b600052603260045260246000fd5b600091825260209091206005600690920201015460ff16156103765760405162461bcd60e51b815260206004820152600d60248201526c496e76616c6964207374616b6560981b6044820152606401610297565b6003543360009081526006602052604090208054839081106103a857634e487b7160e01b600052603260045260246000fd5b906000526020600020906006020160000154426103c591906111c9565b1015610739576004543360009081526006602052604081208054919260649260ff90911691908590811061040957634e487b7160e01b600052603260045260246000fd5b90600052602060002090600602016001015461042591906111aa565b61042f919061118a565b60025433600081815260066020526040902080549394506001600160a01b039092169263a9059cbb9285918790811061047857634e487b7160e01b600052603260045260246000fd5b90600052602060002090600602016001015461049491906111c9565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381600087803b1580156104da57600080fd5b505af11580156104ee573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061051291906110e6565b61051b57600080fd5b6002546001600160a01b031663a9059cbb61053e6000546001600160a01b031690565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101849052604401602060405180830381600087803b15801561058657600080fd5b505af115801561059a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105be91906110e6565b6105c757600080fd5b3360009081526006602052604090208054829190849081106105f957634e487b7160e01b600052603260045260246000fd5b60009182526020808320600692830201600301939093553382529091526040902080544291908490811061063d57634e487b7160e01b600052603260045260246000fd5b6000918252602080832060069283020160040193909355338252909152604090208054600191908490811061068257634e487b7160e01b600052603260045260246000fd5b60009182526020808320600692830201600501805460ff1916941515949094179093553380835292526040902080547f1deb31f039e2645a4e97af07659090228d39e7f992bfaf37af3838ad9665e23a9190859081106106f257634e487b7160e01b600052603260045260246000fd5b6000918252602082206001600690920201015460405161072b928691889093845260208401929092526040830152606082015260800190565b60405180910390a250610ba4565b60006107453383610f8e565b60025490915081906001600160a01b031663dd62ed3e61076d6000546001600160a01b031690565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015230602482015260440160206040518083038186803b1580156107b257600080fd5b505afa1580156107c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107ea919061111e565b10158015610892575060025481906001600160a01b03166370a082316108186000546001600160a01b031690565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260240160206040518083038186803b15801561085757600080fd5b505afa15801561086b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061088f919061111e565b10155b1561094e576002546001600160a01b03166323b872dd6108ba6000546001600160a01b031690565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015233602482015260448101849052606401602060405180830381600087803b15801561090857600080fd5b505af115801561091c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094091906110e6565b61094957600080fd5b610952565b5060005b60025433600081815260066020526040902080546001600160a01b039093169263a9059cbb9291908690811061099857634e487b7160e01b600052603260045260246000fd5b60009182526020909120600160069092020101546040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381600087803b1580156109f257600080fd5b505af1158015610a06573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a2a91906110e6565b610a3357600080fd5b336000908152600660205260409020805482919084908110610a6557634e487b7160e01b600052603260045260246000fd5b600091825260208083206006928302016002019390935533825290915260409020805442919084908110610aa957634e487b7160e01b600052603260045260246000fd5b60009182526020808320600692830201600401939093553382529091526040902080546001919084908110610aee57634e487b7160e01b600052603260045260246000fd5b60009182526020808320600692830201600501805460ff1916941515949094179093553380835292526040902080547f1deb31f039e2645a4e97af07659090228d39e7f992bfaf37af3838ad9665e23a919085908110610b5e57634e487b7160e01b600052603260045260246000fd5b90600052602060002090600602016001015460008486604051610b9a949392919093845260208401929092526040830152606082015260800190565b60405180910390a2505b5060018055565b6000546001600160a01b03163314610bfb5760405162461bcd60e51b815260206004820152601360248201527221b0b63632b91034b9903737ba1037bbb732b960691b6044820152606401610297565b60648160ff161115610c3f5760405162461bcd60e51b815260206004820152600d60248201526c496e76616c69642076616c756560981b6044820152606401610297565b6005939093556003919091556002805461ffff60a01b1916600160a01b61ffff909316929092029190911790556004805460ff191660ff909216919091179055565b60066020528160005260406000208181548110610c9d57600080fd5b600091825260209091206006909102018054600182015460028301546003840154600485015460059095015493965091945092909160ff1686565b60026001541415610d2b5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610297565b6002600155600554811015610d725760405162461bcd60e51b815260206004820152600d60248201526c496e76616c69642076616c756560981b6044820152606401610297565b6002546040516323b872dd60e01b8152336004820152306024820152604481018390526001600160a01b03909116906323b872dd90606401602060405180830381600087803b158015610dc457600080fd5b505af1158015610dd8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dfc91906110e6565b610e0557600080fd5b336000818152600660208181526040808420815160c081018352428152808401888152928101868152606082018781526080830188815260a08401898152855460018082018855878c52898c209651918b029096019081559651878601559251600287015590516003860155516004850155516005909301805460ff1916931515939093179092559385905291905290547f01030a23696d25d6138e45b2944d465c807d48422a2700ae29527f92b6cb439c918491610ec491906111c9565b6040805192835260208301919091520160405180910390a25060018055565b6000546001600160a01b03163314610f335760405162461bcd60e51b815260206004820152601360248201527221b0b63632b91034b9903737ba1037bbb732b960691b6044820152606401610297565b600080546040516001600160a01b03808516939216917f342827c97908e5e2f71151c08502a66d44b6f758e3ac2f1de95f02eb95f0a73591a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0382166000908152600660205260408120805482919084908110610fc957634e487b7160e01b600052603260045260246000fd5b90600052602060002090600602016000015442610fe691906111c9565b6002546001600160a01b038616600090815260066020526040902080549293506301e13380928392606492600160a01b90910461ffff16918890811061103c57634e487b7160e01b600052603260045260246000fd5b9060005260206000209060060201600101548561105991906111aa565b61106391906111aa565b61106d919061118a565b611077919061118a565b95945050505050565b80356001600160a01b038116811461109757600080fd5b919050565b6000602082840312156110ad578081fd5b6110b682611080565b9392505050565b600080604083850312156110cf578081fd5b6110d883611080565b946020939093013593505050565b6000602082840312156110f7578081fd5b815180151581146110b6578182fd5b600060208284031215611117578081fd5b5035919050565b60006020828403121561112f578081fd5b5051919050565b6000806000806080858703121561114b578182fd5b8435935060208501359250604085013561ffff8116811461116a578283fd5b9150606085013560ff8116811461117f578182fd5b939692955090935050565b6000826111a557634e487b7160e01b81526012600452602481fd5b500490565b60008160001904831182151516156111c4576111c46111e0565b500290565b6000828210156111db576111db6111e0565b500390565b634e487b7160e01b600052601160045260246000fdfea2646970667358221220df76108218fa5ecf41c8897d8e4f6b8580395e71ad99fe615b680b9e8f48e7c364736f6c63430008040033000000000000000000000000e4379a25a0db888e19ec2c14416fe68a62aca5cc000000000000000000000000e4379a25a0db888e19ec2c14416fe68a62aca5cc000000000000000000000000000000000000000000000000000000000000000b000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000a
Age | Block | Fee Address | BC Fee Address | Voting Power | Jailed | Incoming |
---|
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.