Contract 0x0c7126b0c7e79c1ea6930bed8499fedb87cd2006

 

TxHash Block Age From To Value [TxFee]
0xa67396962be4f54eb233dc0f72cf81b495678160925228382d09332bfa770394672500991 days 12 hrs ago0x6b11e11b651c5155f3df2a357bf6c07409d8f590  IN   0x0c7126b0c7e79c1ea6930bed8499fedb87cd20060.05 Ether0.000092823
0xdf48d21c90363c7fa5b397a247dc486e108f0aaef1047071c0e86f1930dced50672490291 days 12 hrs ago0x6b11e11b651c5155f3df2a357bf6c07409d8f590  IN   0x0c7126b0c7e79c1ea6930bed8499fedb87cd20060.05 Ether0.000537228
0xf0194ea79e106dd3bea965cd95196072a7446a2034ac7fefe309d3d1967c9266672488191 days 12 hrs ago0x6b11e11b651c5155f3df2a357bf6c07409d8f590  IN   0x0c7126b0c7e79c1ea6930bed8499fedb87cd20060.05 Ether0.00045
0x1bd8633f9061a9950cedc9ca767ebe006172c65c6fcc5b96828f80f6f50cfb50672446091 days 14 hrs ago0xcc696d24408942f074cecc45f27aacdaef1810d3  IN   Contract Creation0 Ether0.001245798
[ Download CSV Export 

Internal Transactions as a result of Contract Execution

Parent TxHash Block Age From To Value
Contract Source Code Verified (Exact Match)
Contract Name: CoooinsCoinAd
Compiler Version: v0.4.25+commit.59dbf8f1
Optimization Enabled: Yes
Runs (Optimizer):  200


Contract Source Code
pragma solidity ^0.4.25;

/**
 * @title SafeMath
 * @dev Math operations with safety checks that throw on error
 */
library SafeMath {

  /**
  * @dev Multiplies two numbers, throws on overflow.
  */
  function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
    if (a == 0) {
      return 0;
    }
    c = a * b;
    assert(c / a == b);
    return c;
  }

  /**
  * @dev Integer division of two numbers, truncating the quotient.
  */
  function div(uint256 a, uint256 b) internal pure returns (uint256) {
    // assert(b > 0); // Solidity automatically throws when dividing by 0
    // uint256 c = a / b;
    // assert(a == b * c + a % b); // There is no case in which this doesn't hold
    return a / b;
  }

  /**
  * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
  */
  function sub(uint256 a, uint256 b) internal pure returns (uint256) {
    assert(b <= a);
    return a - b;
  }

  /**
  * @dev Adds two numbers, throws on overflow.
  */
  function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
    c = a + b;
    assert(c >= a);
    return c;
  }
}

contract CoooinsCoinAd {

	using SafeMath for uint256;

	string public adMessage;
	string public adUrl;
	uint256 public purchaseTimestamp;
	uint256 public purchaseSeconds;
	uint256 public adPriceWeek;
	uint256 public adPriceMonth;
	address public contractOwner;

	event newAd(address indexed buyer, uint256 amount, string adMessage, string adUrl, uint256 purchaseSeconds, uint256 purchaseTimestamp);

	modifier onlyContractOwner {
		require(msg.sender == contractOwner);
		_;
	}

	constructor() public {
		adPriceWeek = 50000000000000000;
		adPriceMonth = 150000000000000000;
		contractOwner = 0x2E26a4ac59094DA46a0D8d65D90A7F7B51E5E69A;
	}

	function withdraw() public onlyContractOwner {
		contractOwner.transfer(address(this).balance);
	}

	function setAdPriceWeek(uint256 amount) public onlyContractOwner {
		adPriceWeek = amount;
	}

	function setAdPriceMonth(uint256 amount) public onlyContractOwner {
		adPriceMonth = amount;
	}

	function updateAd(string message, string url) public payable {
		// set minimum amount and make sure ad hasnt expired
		require(msg.value >= adPriceWeek);
		require(block.timestamp > purchaseTimestamp.add(purchaseSeconds));

		// set ad time limit in seconds
		if (msg.value >= adPriceMonth) {
			purchaseSeconds = 2592000; // 1 month
		} else {
			purchaseSeconds = 604800; // 1 week
		}

		adMessage = message;
		adUrl = url;

		purchaseTimestamp = block.timestamp;

		emit newAd(msg.sender, msg.value, adMessage, adUrl, purchaseSeconds, purchaseTimestamp);
	}

	function getPurchaseTimestampEnds() public view returns (uint _getPurchaseTimestampAdEnds) {
		return purchaseTimestamp.add(purchaseSeconds);
	}

	function getBalance() public view returns(uint256){
		return address(this).balance;
	}

}

Contract ABI
[{"constant":false,"inputs":[{"name":"message","type":"string"},{"name":"url","type":"string"}],"name":"updateAd","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"getBalance","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"purchaseTimestamp","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"withdraw","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"adPriceMonth","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"adMessage","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"amount","type":"uint256"}],"name":"setAdPriceWeek","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getPurchaseTimestampEnds","outputs":[{"name":"_getPurchaseTimestampAdEnds","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"amount","type":"uint256"}],"name":"setAdPriceMonth","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"adUrl","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"adPriceWeek","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"contractOwner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"purchaseSeconds","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"buyer","type":"address"},{"indexed":false,"name":"amount","type":"uint256"},{"indexed":false,"name":"adMessage","type":"string"},{"indexed":false,"name":"adUrl","type":"string"},{"indexed":false,"name":"purchaseSeconds","type":"uint256"},{"indexed":false,"name":"purchaseTimestamp","type":"uint256"}],"name":"newAd","type":"event"}]

Contract Creation Code
608060405234801561001057600080fd5b5066b1a2bc2ec50000600455670214e8348c4f000060055560068054600160a060020a031916732e26a4ac59094da46a0d8d65d90a7f7b51e5e69a17905561076b8061005d6000396000f3006080604052600436106100c45763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663077ca11d81146100c957806312065fe01461015557806325d3d0e31461017c5780633ccfd60b146101915780634c4ef642146101a65780636418f985146101bb5780638237b6d0146102455780638cc4ab111461025d578063c149691314610272578063c7de6e691461028a578063cbe211ec1461029f578063ce606ee0146102b4578063e2954a14146102e5575b600080fd5b6040805160206004803580820135601f810184900484028501840190955284845261015394369492936024939284019190819084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a9998810197919650918201945092508291508401838280828437509497506102fa9650505050505050565b005b34801561016157600080fd5b5061016a6104d5565b60408051918252519081900360200190f35b34801561018857600080fd5b5061016a6104db565b34801561019d57600080fd5b506101536104e1565b3480156101b257600080fd5b5061016a610535565b3480156101c757600080fd5b506101d061053b565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561020a5781810151838201526020016101f2565b50505050905090810190601f1680156102375780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561025157600080fd5b506101536004356105c9565b34801561026957600080fd5b5061016a6105e5565b34801561027e57600080fd5b50610153600435610603565b34801561029657600080fd5b506101d061061f565b3480156102ab57600080fd5b5061016a610679565b3480156102c057600080fd5b506102c961067f565b60408051600160a060020a039092168252519081900360200190f35b3480156102f157600080fd5b5061016a61068e565b60045434101561030957600080fd5b60035460025461031e9163ffffffff61069416565b421161032957600080fd5b600554341061033e5762278d00600355610346565b62093a806003555b81516103599060009060208501906106a7565b50805161036d9060019060208401906106a7565b504260028190555033600160a060020a03167f14d50cf146c5881b5dd04dba32b070c0d310ebb825b5bfd5d0b853ad8cdafa19346000600160035460025460405180868152602001806020018060200185815260200184815260200183810383528781815460018160011615610100020316600290048152602001915080546001816001161561010002031660029004801561044a5780601f1061041f5761010080835404028352916020019161044a565b820191906000526020600020905b81548152906001019060200180831161042d57829003601f168201915b50508381038252865460026000196101006001841615020190911604808252602090910190879080156104be5780601f10610493576101008083540402835291602001916104be565b820191906000526020600020905b8154815290600101906020018083116104a157829003601f168201915b505097505050505050505060405180910390a25050565b30315b90565b60025481565b600654600160a060020a031633146104f857600080fd5b600654604051600160a060020a0390911690303180156108fc02916000818181858888f19350505050158015610532573d6000803e3d6000fd5b50565b60055481565b6000805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156105c15780601f10610596576101008083540402835291602001916105c1565b820191906000526020600020905b8154815290600101906020018083116105a457829003601f168201915b505050505081565b600654600160a060020a031633146105e057600080fd5b600455565b60006105fe60035460025461069490919063ffffffff16565b905090565b600654600160a060020a0316331461061a57600080fd5b600555565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156105c15780601f10610596576101008083540402835291602001916105c1565b60045481565b600654600160a060020a031681565b60035481565b818101828110156106a157fe5b92915050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106106e857805160ff1916838001178555610715565b82800160010185558215610715579182015b828111156107155782518255916020019190600101906106fa565b50610721929150610725565b5090565b6104d891905b80821115610721576000815560010161072b5600a165627a7a72305820d1ed7c12d4b716bf25c726a7d210b9318f4879b7371b3c0a948de2005a5834a40029


   Swarm Source:
bzzr://d1ed7c12d4b716bf25c726a7d210b9318f4879b7371b3c0a948de2005a5834a4
Block Age transaction Difficulty GasUsed Reward
Block Age Uncle Number Difficulty GasUsed Reward
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.