Contract 0xd6f9b1df49718eb134d02a06ac048e50931a7a6c

 

Contract Overview

Balance:
0.447941176470588228 Ether

EtherValue:
$62.18 (@ $138.82/ETH)
TxHash Block Age From To Value [TxFee]
0x9d2791fa234e5bee472c57aaea33dfcbc5ced51197ccfe96e0374d7005a86d096182272211 days 8 hrs ago0x92b9a4b57b4a68db7d26b7b83bf98beeda69d440 IN  0xd6f9b1df49718eb134d02a06ac048e50931a7a6c0.094117647058823 Ether0.00017072
0x494a8de721a2c44a7823a5cfc47814d1cd98b3cf80b0a44b53621ace4919e5666182242211 days 8 hrs ago0x92b9a4b57b4a68db7d26b7b83bf98beeda69d440 IN  0xd6f9b1df49718eb134d02a06ac048e50931a7a6c0.088235294117647 Ether0.000156156
0x8ceafb076648782f6417ffbf02754bb0d91d3f0b66da13e897f0ca8d42298ee06182230211 days 8 hrs ago0x92b9a4b57b4a68db7d26b7b83bf98beeda69d440 IN  0xd6f9b1df49718eb134d02a06ac048e50931a7a6c0.088235294117647 Ether0.000044616
0x14e5912392fe83fe0e6f50fd99ed1fd2fee00150ef414f2a4c94b806793c7ec15570911316 days 17 hrs ago0x2fcbb6bbb8feb2eb2f241c793a170d57039a7675 IN  0xd6f9b1df49718eb134d02a06ac048e50931a7a6c0.035294117647058 Ether0.000170592
0x848bf1a57b908175340c505d69bad5fa9722c027d59dd6901254b7d1adb6f4ca5262219369 days 1 hr ago0x4db69de4b19593c7122518fab8a531b8731c35d3 IN  0xd6f9b1df49718eb134d02a06ac048e50931a7a6c0.047058823529411 Ether0.000341184
0xfc314ae0dcebb293ffb57c18a3d177f8b40ea26f984fd7ea367d4a8f881cf23c5262208369 days 1 hr ago0x4db69de4b19593c7122518fab8a531b8731c35d3 IN  0xd6f9b1df49718eb134d02a06ac048e50931a7a6c0.017647058823529 Ether0.0002644176
0x0ac714f47cb6985b92752c4e8b86b8ac48d5d6b277fd15bbb579067dd869794d5235002373 days 16 hrs ago0x6d18c6ff5c780fb49f8ac7f9c259e6c3fe44662d IN  0xd6f9b1df49718eb134d02a06ac048e50931a7a6c0.041176470588235 Ether0.00085296
0xca60b0a9976a39c893fe5bd63437fd42f46789725d06a107dba3bc999f3d27c15218820376 days 11 hrs ago0x5bb35c9576ef6e42d4447adcb3272f0b8582e82e IN  0xd6f9b1df49718eb134d02a06ac048e50931a7a6c0.023529411764705 Ether0.000255888
0xea2e978b2a8b4994fd5dedbac371d1df24894448f77d54537bec41dadd01b1b95218296376 days 13 hrs ago0x811950d7592234ac88020f9ae701bfcdcc3dd127 IN  0xd6f9b1df49718eb134d02a06ac048e50931a7a6c0.023529411764705 Ether0.000170592
0x6dc9c0564b2b04f2e0e2cbffad1a048a3a47e95c6febe269c013fc70777c402b5183438382 days 10 hrs ago0xda6fb86f42b3249cbdd76b16fa8f25552db61082 IN  0xd6f9b1df49718eb134d02a06ac048e50931a7a6c0.095 Ether0.001692152
0x268bcb642e487ab59aba69e0ecbd97aa891980aa2ecc87ee26975a00d61e33895173064384 days 5 hrs ago0xc24aa4a2728e299d041241a9a3258c818bb86bf4 IN  0xd6f9b1df49718eb134d02a06ac048e50931a7a6c0.023529411764705 Ether0.00120888
0x60b1593fb551748c0303c7b236670c852a26d27b107df3cfe48ca81aaaa817865173063384 days 5 hrs ago0xc24aa4a2728e299d041241a9a3258c818bb86bf4 IN  0xd6f9b1df49718eb134d02a06ac048e50931a7a6c0.023529411764705 Ether0.000085296
0x186fdd89df9434d3e3f0d0acc449831f5056c3424038c953d659f35b783d1fc25144217389 days 3 hrs ago0x6499dc30d6178413e3812e35af0b5b8116966041 IN  0xd6f9b1df49718eb134d02a06ac048e50931a7a6c0.023529411764705 Ether0.000170464
0x5f81f71addf42030d8dda297c3a74d1d9c984712851cb5781145dba0542786355143234389 days 7 hrs ago0x6499dc30d6178413e3812e35af0b5b8116966041 IN  0xd6f9b1df49718eb134d02a06ac048e50931a7a6c0 Ether0.00042293
0x7b3020b83b968c03a30c0b793126b96a72790f986c6e631517bd7b70e0a6cd975143224389 days 7 hrs ago0x6499dc30d6178413e3812e35af0b5b8116966041 IN  0xd6f9b1df49718eb134d02a06ac048e50931a7a6c0 Ether0.00042293
0x18fc2971d737d56fe450466347c05507b06cdded86a19c43bf42ca31c23839615143210389 days 7 hrs ago0x6499dc30d6178413e3812e35af0b5b8116966041 IN  0xd6f9b1df49718eb134d02a06ac048e50931a7a6c0 Ether0.00042293
0x8a25dc3c482e17091a65d422af1e3d855b492251277487578bfcbf5a78302a275143201389 days 7 hrs ago0x6499dc30d6178413e3812e35af0b5b8116966041 IN  0xd6f9b1df49718eb134d02a06ac048e50931a7a6c0 Ether0.00042293
0x879c8616b4160613a4da8f0bbca9b4c09618d6d50602a04069f3f150d25e52705143192389 days 7 hrs ago0x6499dc30d6178413e3812e35af0b5b8116966041 IN  0xd6f9b1df49718eb134d02a06ac048e50931a7a6c0 Ether0.00042293
0x37f3465be4b77aea8aa21d16e2ddd490c43ee3b6ec467bfb4963bb7f7910de1f5143186389 days 7 hrs ago0x6499dc30d6178413e3812e35af0b5b8116966041 IN  0xd6f9b1df49718eb134d02a06ac048e50931a7a6c0 Ether0.00042293
0x7262d847b0eaba06bddfdd0722fdc0087ad2ec19fca91629d22c45e65143e6ae5143178389 days 7 hrs ago0x6499dc30d6178413e3812e35af0b5b8116966041 IN  0xd6f9b1df49718eb134d02a06ac048e50931a7a6c0 Ether0.00042357
0x2863cce6779e1b30f12dc80ca8fde6cc7b20486efaf30bf0d2325d0091e657f35143172389 days 7 hrs ago0x6499dc30d6178413e3812e35af0b5b8116966041 IN  0xd6f9b1df49718eb134d02a06ac048e50931a7a6c0 Ether0.00042293
0xf444a5de55223f6e430d0c9af42c70120f4b3e3a2a160094b25c27da3e81f8655143166389 days 7 hrs ago0x6499dc30d6178413e3812e35af0b5b8116966041 IN  0xd6f9b1df49718eb134d02a06ac048e50931a7a6c0 Ether0.00042293
0xe3b9ca5983e402fa2bfe8bcc564523b2fbe847193b16c72748583c9d82d8a3445143145389 days 7 hrs ago0x6499dc30d6178413e3812e35af0b5b8116966041 IN  Contract Creation0 Ether0.00782821
[ 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:
ZastrinPay

Compiler Version
v0.4.18+commit.9cf6e910

Optimization Enabled:
No

Runs (Optimizer):
200

Contract Source Code

pragma solidity ^0.4.18;

contract ZastrinPay {

  /*
   * Author: Mahesh Murthy
   * Company: Zastrin, Inc
   * Contact: [email protected]
   */

  address public owner;

  struct paymentInfo {
    uint userId;
    uint amount;
    uint purchasedAt;
    bool refunded;
    bool cashedOut;
  }

  mapping(uint => bool) coursesOffered;
  mapping(address => mapping(uint => paymentInfo)) customers;

  uint fallbackAmount;

  event NewPayment(uint indexed _courseId, uint indexed _userId, address indexed _customer, uint _amount);
  event RefundPayment(uint indexed _courseId, uint indexed _userId, address indexed _customer);

  modifier onlyOwner() {
    require(msg.sender == owner);
    _;
  }

  function ZastrinPay() public {
    owner = msg.sender;
  }

  function addCourse(uint _courseId) public onlyOwner {
    coursesOffered[_courseId] = true;
  }

  function buyCourse(uint _courseId, uint _userId) public payable {
    require(coursesOffered[_courseId]);
    customers[msg.sender][_courseId].amount += msg.value;
    customers[msg.sender][_courseId].purchasedAt = now;
    customers[msg.sender][_courseId].userId = _userId;
    NewPayment(_courseId, _userId, msg.sender, msg.value);
  }

  function getRefund(uint _courseId) public {
    require(customers[msg.sender][_courseId].userId > 0);
    require(customers[msg.sender][_courseId].refunded == false);
    require(customers[msg.sender][_courseId].purchasedAt + (3 hours) > now);
    customers[msg.sender][_courseId].refunded = true;
    msg.sender.transfer(customers[msg.sender][_courseId].amount);
    RefundPayment(_courseId, customers[msg.sender][_courseId].userId, msg.sender);
  }

  function cashOut(address _customer, uint _courseId) public onlyOwner {
    require(customers[_customer][_courseId].refunded == false);
    require(customers[_customer][_courseId].cashedOut == false);
    require(customers[_customer][_courseId].purchasedAt + (3 hours) < now);
    customers[_customer][_courseId].cashedOut = true;
    owner.transfer(customers[_customer][_courseId].amount);
  }

  function cashOutFallbackAmount() public onlyOwner {
    owner.transfer(fallbackAmount);
  }

  function() public payable {
    fallbackAmount += msg.value;
  }
}

Contract ABI

[{"constant":false,"inputs":[{"name":"_customer","type":"address"},{"name":"_courseId","type":"uint256"}],"name":"cashOut","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"cashOutFallbackAmount","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_courseId","type":"uint256"}],"name":"addCourse","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":"_courseId","type":"uint256"},{"name":"_userId","type":"uint256"}],"name":"buyCourse","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"name":"_courseId","type":"uint256"}],"name":"getRefund","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_courseId","type":"uint256"},{"indexed":true,"name":"_userId","type":"uint256"},{"indexed":true,"name":"_customer","type":"address"},{"indexed":false,"name":"_amount","type":"uint256"}],"name":"NewPayment","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_courseId","type":"uint256"},{"indexed":true,"name":"_userId","type":"uint256"},{"indexed":true,"name":"_customer","type":"address"}],"name":"RefundPayment","type":"event"}]

Contract Creation Code

6060604052341561000f57600080fd5b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610a668061005e6000396000f300606060405260043610610078576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063224054431461008a5780636747f09e146100cc578063718a4bca146100e15780638da5cb5b1461010457806399dbff0114610159578063d2f0be991461017a575b34600360008282540192505081905550005b341561009557600080fd5b6100ca600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061019d565b005b34156100d757600080fd5b6100df610467565b005b34156100ec57600080fd5b6101026004808035906020019091905050610527565b005b341561010f57600080fd5b6101176105b0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61017860048080359060200190919080359060200190919050506105d5565b005b341561018557600080fd5b61019b6004808035906020019091905050610766565b005b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156101f857600080fd5b60001515600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002060030160009054906101000a900460ff16151514151561026b57600080fd5b60001515600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002060030160019054906101000a900460ff1615151415156102de57600080fd5b42612a30600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000848152602001908152602001600020600201540110151561034357600080fd5b6001600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002060030160016101000a81548160ff0219169083151502179055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000848152602001908152602001600020600101549081150290604051600060405180830381858888f19350505050151561046357600080fd5b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156104c257600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6003549081150290604051600060405180830381858888f19350505050151561052557600080fd5b565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561058257600080fd5b600180600083815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6001600083815260200190815260200160002060009054906101000a900460ff16151561060157600080fd5b34600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008481526020019081526020016000206001016000828254019250508190555042600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008481526020019081526020016000206002018190555080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000848152602001908152602001600020600001819055503373ffffffffffffffffffffffffffffffffffffffff1681837f607addecb9dcbf740b21be430f43661c581f9df63993f42f6462b800e3b3bee2346040518082815260200191505060405180910390a45050565b6000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000838152602001908152602001600020600001541115156107c857600080fd5b60001515600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002060030160009054906101000a900460ff16151514151561083b57600080fd5b42612a30600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060020154011115156108a057600080fd5b6001600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002060030160006101000a81548160ff0219169083151502179055503373ffffffffffffffffffffffffffffffffffffffff166108fc600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000848152602001908152602001600020600101549081150290604051600060405180830381858888f19350505050151561099f57600080fd5b3373ffffffffffffffffffffffffffffffffffffffff16600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002060000154827f72b5b57e78efb53595df3d273a7f8be01e94f61b4ddbc3e3342f5cfad40e98e660405160405180910390a4505600a165627a7a72305820d01b8b32da953866b4b47edcd06b5e58c98a1ccee7f8552d27f9bfe3e85f9c530029

Swarm Source

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