Overview
ETH Balance
0 ETH
Eth Value
$0.00View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
CooldownEndTimeResetEffect
Compiler Version
v0.4.21+commit.dfe3193c
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2018-04-24 */ pragma solidity ^0.4.20; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { paused = true; emit Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { paused = false; emit Unpause(); } } /// @author https://BlockChainArchitect.iocontract Bank is CutiePluginBase contract PluginInterface { /// @dev simply a boolean to indicate this is the contract we expect to be function isPluginInterface() public pure returns (bool); function onRemove() public; /// @dev Begins new feature. /// @param _cutieId - ID of token to auction, sender must be owner. /// @param _parameter - arbitrary parameter /// @param _seller - Old owner, if not the message sender function run( uint40 _cutieId, uint256 _parameter, address _seller ) public payable; /// @dev Begins new feature, approved and signed by COO. /// @param _cutieId - ID of token to auction, sender must be owner. /// @param _parameter - arbitrary parameter function runSigned( uint40 _cutieId, uint256 _parameter, address _owner ) external payable; function withdraw() public; } contract CutieCoreInterface { function isCutieCore() pure public returns (bool); function transferFrom(address _from, address _to, uint256 _cutieId) external; function transfer(address _to, uint256 _cutieId) external; function ownerOf(uint256 _cutieId) external view returns (address owner); function getCutie(uint40 _id) external view returns ( uint256 genes, uint40 birthTime, uint40 cooldownEndTime, uint40 momId, uint40 dadId, uint16 cooldownIndex, uint16 generation ); function getGenes(uint40 _id) public view returns ( uint256 genes ); function getCooldownEndTime(uint40 _id) public view returns ( uint40 cooldownEndTime ); function getCooldownIndex(uint40 _id) public view returns ( uint16 cooldownIndex ); function getGeneration(uint40 _id) public view returns ( uint16 generation ); function getOptional(uint40 _id) public view returns ( uint64 optional ); function changeGenes( uint40 _cutieId, uint256 _genes) public; function changeCooldownEndTime( uint40 _cutieId, uint40 _cooldownEndTime) public; function changeCooldownIndex( uint40 _cutieId, uint16 _cooldownIndex) public; function changeOptional( uint40 _cutieId, uint64 _optional) public; function changeGeneration( uint40 _cutieId, uint16 _generation) public; } /// @author https://BlockChainArchitect.iocontract Bank is CutiePluginBase contract CutiePluginBase is PluginInterface, Pausable { function isPluginInterface() public pure returns (bool) { return true; } // Reference to contract tracking NFT ownership CutieCoreInterface public coreContract; // Cut owner takes on each auction, measured in basis points (1/100 of a percent). // Values 0-10,000 map to 0%-100% uint16 public ownerFee; // @dev Throws if called by any account other than the owner. modifier onlyCore() { require(msg.sender == address(coreContract)); _; } /// @dev Constructor creates a reference to the NFT ownership contract /// and verifies the owner cut is in the valid range. /// @param _coreAddress - address of a deployed contract implementing /// the Nonfungible Interface. /// @param _fee - percent cut the owner takes on each auction, must be /// between 0-10,000. function setup(address _coreAddress, uint16 _fee) public { require(_fee <= 10000); require(msg.sender == owner); ownerFee = _fee; CutieCoreInterface candidateContract = CutieCoreInterface(_coreAddress); require(candidateContract.isCutieCore()); coreContract = candidateContract; } // @dev Set the owner's fee. // @param fee should be between 0-10,000. function setFee(uint16 _fee) public { require(_fee <= 10000); require(msg.sender == owner); ownerFee = _fee; } /// @dev Returns true if the claimant owns the token. /// @param _claimant - Address claiming to own the token. /// @param _cutieId - ID of token whose ownership to verify. function _isOwner(address _claimant, uint40 _cutieId) internal view returns (bool) { return (coreContract.ownerOf(_cutieId) == _claimant); } /// @dev Escrows the NFT, assigning ownership to this contract. /// Throws if the escrow fails. /// @param _owner - Current owner address of token to escrow. /// @param _cutieId - ID of token whose approval to verify. function _escrow(address _owner, uint40 _cutieId) internal { // it will throw if transfer fails coreContract.transferFrom(_owner, this, _cutieId); } /// @dev Transfers an NFT owned by this contract to another address. /// Returns true if the transfer succeeds. /// @param _receiver - Address to transfer NFT to. /// @param _cutieId - ID of token to transfer. function _transfer(address _receiver, uint40 _cutieId) internal { // it will throw if transfer fails coreContract.transfer(_receiver, _cutieId); } /// @dev Computes owner's cut of a sale. /// @param _price - Sale price of NFT. function _computeFee(uint128 _price) internal view returns (uint128) { // NOTE: We don't use SafeMath (or similar) in this function because // all of our entry functions carefully cap the maximum values for // currency (at 128-bits), and ownerFee <= 10000 (see the require() // statement in the ClockAuction constructor). The result of this // function is always guaranteed to be <= _price. return _price * ownerFee / 10000; } function withdraw() public { require( msg.sender == owner || msg.sender == address(coreContract) ); if (address(this).balance > 0) { address(coreContract).transfer(address(this).balance); } } function onRemove() public onlyCore { withdraw(); } } /// @title Item effect for Blockchain Cuties /// @author https://BlockChainArchitect.io contract CooldownEndTimeResetEffect is CutiePluginBase { function run( uint40, uint256, address ) public payable onlyCore { revert(); } function runSigned( uint40 _cutieId, uint256 /*_parameter*/, address /*_owner*/ ) external onlyCore whenNotPaused payable { uint40 t = coreContract.getCooldownEndTime(_cutieId); if (t > now) { coreContract.changeCooldownEndTime(_cutieId, uint40(now)); } else { // not required revert(); } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"constant":false,"inputs":[],"name":"onRemove","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"withdraw","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"unpause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"paused","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"pause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_fee","type":"uint16"}],"name":"setFee","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"isPluginInterface","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":false,"inputs":[{"name":"_cutieId","type":"uint40"},{"name":"","type":"uint256"},{"name":"","type":"address"}],"name":"runSigned","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"name":"","type":"uint40"},{"name":"","type":"uint256"},{"name":"","type":"address"}],"name":"run","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"ownerFee","outputs":[{"name":"","type":"uint16"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_coreAddress","type":"address"},{"name":"_fee","type":"uint16"}],"name":"setup","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"coreContract","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"anonymous":false,"inputs":[],"name":"Pause","type":"event"},{"anonymous":false,"inputs":[],"name":"Unpause","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"}]
Contract Creation Code
606060405260008054600160a060020a033316600160a860020a0319909116179055610784806100306000396000f3006060604052600436106100b65763ffffffff60e060020a6000350416631195236981146100bb5780633ccfd60b146100d05780633f4ba83a146100e35780635c975abb146100f65780638456cb591461011d5780638da5cb5b146101305780638e0055531461015f57806394a89233146101795780639652713e1461018c578063a055d455146101ad578063d5b2a01a146101ce578063e410a0c6146101f8578063e80db5db1461021e578063f2fde38b14610231575b600080fd5b34156100c657600080fd5b6100ce610250565b005b34156100db57600080fd5b6100ce610275565b34156100ee57600080fd5b6100ce6102f7565b341561010157600080fd5b610109610376565b604051901515815260200160405180910390f35b341561012857600080fd5b6100ce610386565b341561013b57600080fd5b61014361040a565b604051600160a060020a03909116815260200160405180910390f35b341561016a57600080fd5b6100ce61ffff60043516610419565b341561018457600080fd5b61010961047a565b6100ce64ffffffffff60043516602435600160a060020a036044351661047f565b6100ce64ffffffffff60043516602435600160a060020a0360443516610595565b34156101d957600080fd5b6101e16105b0565b60405161ffff909116815260200160405180910390f35b341561020357600080fd5b6100ce600160a060020a036004351661ffff602435166105c1565b341561022957600080fd5b6101436106ae565b341561023c57600080fd5b6100ce600160a060020a03600435166106bd565b60015433600160a060020a0390811691161461026b57600080fd5b610273610275565b565b60005433600160a060020a03908116911614806102a0575060015433600160a060020a039081169116145b15156102ab57600080fd5b600030600160a060020a031631111561027357600154600160a060020a039081169030163180156108fc0290604051600060405180830381858888f19350505050151561027357600080fd5b60005433600160a060020a0390811691161461031257600080fd5b60005460a060020a900460ff16151561032a57600080fd5b6000805474ff0000000000000000000000000000000000000000191690557f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b60005460a060020a900460ff1681565b60005433600160a060020a039081169116146103a157600080fd5b60005460a060020a900460ff16156103b857600080fd5b6000805474ff0000000000000000000000000000000000000000191660a060020a1790557f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600054600160a060020a031681565b61271061ffff8216111561042c57600080fd5b60005433600160a060020a0390811691161461044757600080fd5b6001805461ffff90921660a060020a0275ffff000000000000000000000000000000000000000019909216919091179055565b600190565b60015460009033600160a060020a0390811691161461049d57600080fd5b60005460a060020a900460ff16156104b457600080fd5b600154600160a060020a031663f6dfcff78560405160e060020a63ffffffff841602815264ffffffffff9091166004820152602401602060405180830381600087803b151561050257600080fd5b5af1151561050f57600080fd5b50505060405180519150504264ffffffffff821611156100b657600154600160a060020a031663c4791421854260405160e060020a63ffffffff851602815264ffffffffff928316600482015291166024820152604401600060405180830381600087803b151561057f57600080fd5b5af1151561058c57600080fd5b50505050505050565b60015433600160a060020a039081169116146100b657600080fd5b60015460a060020a900461ffff1681565b600061271061ffff831611156105d657600080fd5b60005433600160a060020a039081169116146105f157600080fd5b506001805475ffff0000000000000000000000000000000000000000191660a060020a61ffff84160217905581600160a060020a038116634d6a813a6040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561065b57600080fd5b5af1151561066857600080fd5b50505060405180519050151561067d57600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555050565b600154600160a060020a031681565b60005433600160a060020a039081169116146106d857600080fd5b600160a060020a03811615156106ed57600080fd5b600054600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555600a165627a7a7230582066eb41fec9f3f818e5e35d493444be53d63bd401234fb1063faeb3308d8e076c0029
Deployed Bytecode
0x6060604052600436106100b65763ffffffff60e060020a6000350416631195236981146100bb5780633ccfd60b146100d05780633f4ba83a146100e35780635c975abb146100f65780638456cb591461011d5780638da5cb5b146101305780638e0055531461015f57806394a89233146101795780639652713e1461018c578063a055d455146101ad578063d5b2a01a146101ce578063e410a0c6146101f8578063e80db5db1461021e578063f2fde38b14610231575b600080fd5b34156100c657600080fd5b6100ce610250565b005b34156100db57600080fd5b6100ce610275565b34156100ee57600080fd5b6100ce6102f7565b341561010157600080fd5b610109610376565b604051901515815260200160405180910390f35b341561012857600080fd5b6100ce610386565b341561013b57600080fd5b61014361040a565b604051600160a060020a03909116815260200160405180910390f35b341561016a57600080fd5b6100ce61ffff60043516610419565b341561018457600080fd5b61010961047a565b6100ce64ffffffffff60043516602435600160a060020a036044351661047f565b6100ce64ffffffffff60043516602435600160a060020a0360443516610595565b34156101d957600080fd5b6101e16105b0565b60405161ffff909116815260200160405180910390f35b341561020357600080fd5b6100ce600160a060020a036004351661ffff602435166105c1565b341561022957600080fd5b6101436106ae565b341561023c57600080fd5b6100ce600160a060020a03600435166106bd565b60015433600160a060020a0390811691161461026b57600080fd5b610273610275565b565b60005433600160a060020a03908116911614806102a0575060015433600160a060020a039081169116145b15156102ab57600080fd5b600030600160a060020a031631111561027357600154600160a060020a039081169030163180156108fc0290604051600060405180830381858888f19350505050151561027357600080fd5b60005433600160a060020a0390811691161461031257600080fd5b60005460a060020a900460ff16151561032a57600080fd5b6000805474ff0000000000000000000000000000000000000000191690557f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b60005460a060020a900460ff1681565b60005433600160a060020a039081169116146103a157600080fd5b60005460a060020a900460ff16156103b857600080fd5b6000805474ff0000000000000000000000000000000000000000191660a060020a1790557f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600054600160a060020a031681565b61271061ffff8216111561042c57600080fd5b60005433600160a060020a0390811691161461044757600080fd5b6001805461ffff90921660a060020a0275ffff000000000000000000000000000000000000000019909216919091179055565b600190565b60015460009033600160a060020a0390811691161461049d57600080fd5b60005460a060020a900460ff16156104b457600080fd5b600154600160a060020a031663f6dfcff78560405160e060020a63ffffffff841602815264ffffffffff9091166004820152602401602060405180830381600087803b151561050257600080fd5b5af1151561050f57600080fd5b50505060405180519150504264ffffffffff821611156100b657600154600160a060020a031663c4791421854260405160e060020a63ffffffff851602815264ffffffffff928316600482015291166024820152604401600060405180830381600087803b151561057f57600080fd5b5af1151561058c57600080fd5b50505050505050565b60015433600160a060020a039081169116146100b657600080fd5b60015460a060020a900461ffff1681565b600061271061ffff831611156105d657600080fd5b60005433600160a060020a039081169116146105f157600080fd5b506001805475ffff0000000000000000000000000000000000000000191660a060020a61ffff84160217905581600160a060020a038116634d6a813a6040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561065b57600080fd5b5af1151561066857600080fd5b50505060405180519050151561067d57600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555050565b600154600160a060020a031681565b60005433600160a060020a039081169116146106d857600080fd5b600160a060020a03811615156106ed57600080fd5b600054600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555600a165627a7a7230582066eb41fec9f3f818e5e35d493444be53d63bd401234fb1063faeb3308d8e076c0029
Swarm Source
bzzr://66eb41fec9f3f818e5e35d493444be53d63bd401234fb1063faeb3308d8e076c
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 34 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.