Sponsored Link:   COVESTING - EU-based digital asset exchange. Aggregated liquidity. Algorithmic & Copy-trading features. 24/7 support. Get access!
Contract Overview
Balance: 0.065340000000000004 Ether
Ether Value: $35.15 (@ $537.94/ETH)
Transactions: 7 txns
Misc
Address Watch: Add To Watch List
Contract Creator: 0x56fb0f1c70397f5f2e3de30cdd36ac703ff3c3beat txn 0x8c266c28fd606bcd507b2e8f65be79206f7af0b71de25ad8dd62c7d470c81379
Token Balances:
 Latest 7 txns


TxHash Age From To Value [TxFee]
0x79ff8ff2cfdde98c83c676f831f41c61c0660ba6eb4276666f29c9880cc07fa213 days 14 hrs ago0x91cd8968837e04bc29e2f63f1d65cb22ca4013c1  IN   0x19f08ceb3783658c30c33b8692c80eecfd8457bd0.034 Ether0.000389524
0xed61d9c032eff1561f65bf52977a99c808cf33cb171fa4734c3ff005ab016d98173 days 4 hrs ago0xb2142e26986296dae415337eae92f14747009719  IN   0x19f08ceb3783658c30c33b8692c80eecfd8457bd0.001 Ether0.002239763
0xdbf900da6e324aa2c4af5e28404629d1c47fd265c20060ebf1a3e68f37602cf4173 days 14 hrs ago0xcb7e4c6df0ac6a4dc681299b1e56906de68e53a0  IN   0x19f08ceb3783658c30c33b8692c80eecfd8457bd0.03 Ether0.00194762
0xc7300726887333e8d90126d5f87ffc37a9eef990f3084e8db175252f8b17adf6175 days 19 hrs ago0x56fb0f1c70397f5f2e3de30cdd36ac703ff3c3be  IN   0x19f08ceb3783658c30c33b8692c80eecfd8457bd0.001 Ether0.002045001
0xa380b6037e63180b3485e85f2cccb737eaf8a141088770f3b9a9dbf8b6c1385f175 days 23 hrs ago0x56fb0f1c70397f5f2e3de30cdd36ac703ff3c3be  IN   0x19f08ceb3783658c30c33b8692c80eecfd8457bd0 Ether0.001367646
0x7a819eecb1e38a6fcb62c6dd4af882eca46e34eba667158d75ec4e0bd7bbe7d5176 days 3 mins ago0x56fb0f1c70397f5f2e3de30cdd36ac703ff3c3be  IN   0x19f08ceb3783658c30c33b8692c80eecfd8457bd0.001 Ether0.002045001
0x8c266c28fd606bcd507b2e8f65be79206f7af0b71de25ad8dd62c7d470c81379176 days 24 mins ago0x56fb0f1c70397f5f2e3de30cdd36ac703ff3c3be  IN    Contract Creation0 Ether0.009456321
[ Download CSV Export  ] 
 Internal Transactions as a result of Contract Execution
 Latest 6 Internal Transactions

ParentTxHash Block Age From To Value
0x79ff8ff2cfdde98c83c676f831f41c61c0660ba6eb4276666f29c9880cc07fa2573871613 days 14 hrs ago0x19f08ceb3783658c30c33b8692c80eecfd8457bd0x56fb0f1c70397f5f2e3de30cdd36ac703ff3c3be0.00034 Ether
0xed61d9c032eff1561f65bf52977a99c808cf33cb171fa4734c3ff005ab016d984811483173 days 4 hrs ago0x19f08ceb3783658c30c33b8692c80eecfd8457bd0x56fb0f1c70397f5f2e3de30cdd36ac703ff3c3be0.00001 Ether
0xdbf900da6e324aa2c4af5e28404629d1c47fd265c20060ebf1a3e68f37602cf44808837173 days 14 hrs ago0x19f08ceb3783658c30c33b8692c80eecfd8457bd0x56fb0f1c70397f5f2e3de30cdd36ac703ff3c3be0.0003 Ether
0xc7300726887333e8d90126d5f87ffc37a9eef990f3084e8db175252f8b17adf64795690175 days 19 hrs ago0x19f08ceb3783658c30c33b8692c80eecfd8457bd0x56fb0f1c70397f5f2e3de30cdd36ac703ff3c3be0.00001 Ether
0xa380b6037e63180b3485e85f2cccb737eaf8a141088770f3b9a9dbf8b6c1385f4794573175 days 23 hrs ago0x19f08ceb3783658c30c33b8692c80eecfd8457bd0x616316fcf273a992529c84d0f98e193fb89fc51b0.00099 Ether
0x7a819eecb1e38a6fcb62c6dd4af882eca46e34eba667158d75ec4e0bd7bbe7d54794536176 days 3 mins ago0x19f08ceb3783658c30c33b8692c80eecfd8457bd0x56fb0f1c70397f5f2e3de30cdd36ac703ff3c3be0.00001 Ether
[ Download CSV Export  ] 
Warning: The compiled contract might be susceptible to ZeroFunctionSelector (very low-severity) Solidity compiler bugs.

Contract Source Code Verified (Exact match)
Contract Name: EtherCard
Compiler Version: v0.4.17+commit.bdeb9e52
Optimization Enabled: No
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts

pragma solidity ^0.4.17;

contract EtherCard {

  struct Gift {
      uint256 amount;
      uint256 amountToRedeem;
      bool redeemed;
      address from;
  }
  
  // Who created this contract
  address public owner;
  mapping (bytes32 => Gift) gifts;
  uint256 feeAmount;

  function EtherCard() public {
    owner = msg.sender;
    feeAmount = 100; //1% of the gift amount
  }

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

  function getAmountByCoupon(bytes32 hash) public view returns (uint256) {
      return gifts[hash].amountToRedeem;
  }

  function getRedemptionStatus(bytes32 hash) public view returns (bool) {
      return gifts[hash].redeemed;
  }

  // Called when someone tries to redeem the gift
  function redeemGift(string coupon, address wallet) public returns (uint256) {
      bytes32 hash = keccak256(coupon);
      Gift storage gift = gifts[hash];
      if ((gift.amount <= 0) || gift.redeemed) {
          return 0;
      }
      uint256 amount = gift.amountToRedeem;
      wallet.transfer(amount);
      gift.redeemed = true;
      return amount;
  }

  // Called when someone sends ETH to this contract function
  function createGift(bytes32 hashedCoupon) public payable {
        if (msg.value * 1000 < 1) { // Send minimum 0.001 ETH
            return;
        }
        uint256 calculatedFees = msg.value/feeAmount;
        
        var gift = gifts[hashedCoupon];
        gift.amount = msg.value;
        gift.amountToRedeem = msg.value - calculatedFees;
        gift.from = msg.sender;
        gift.redeemed = false;

        //Transfer ether to owner
        owner.transfer(calculatedFees);                
  }
}

    Contract ABI  
[{"constant":true,"inputs":[],"name":"getBalance","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"hashedCoupon","type":"bytes32"}],"name":"createGift","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[{"name":"hash","type":"bytes32"}],"name":"getRedemptionStatus","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"coupon","type":"string"},{"name":"wallet","type":"address"}],"name":"redeemGift","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"hash","type":"bytes32"}],"name":"getAmountByCoupon","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"}]

  Contract Creation Code Switch To Opcodes View
6060604052341561000f57600080fd5b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506064600281905550610532806100666000396000f30060606040523615610076576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806312065fe01461007b5780631c4261f4146100a45780636994a62b146100c05780638da5cb5b146100ff578063b41960d414610154578063db6be871146101e4575b600080fd5b341561008657600080fd5b61008e61021f565b6040518082815260200191505060405180910390f35b6100be60048080356000191690602001909190505061023e565b005b34156100cb57600080fd5b6100e560048080356000191690602001909190505061035b565b604051808215151515815260200191505060405180910390f35b341561010a57600080fd5b610112610390565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561015f57600080fd5b6101ce600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506103b5565b6040518082815260200191505060405180910390f35b34156101ef57600080fd5b6102096004808035600019169060200190919050506104de565b6040518082815260200191505060405180910390f35b60003073ffffffffffffffffffffffffffffffffffffffff1631905090565b60008060016103e83402101561025357610356565b6002543481151561026057fe5b04915060016000846000191660001916815260200190815260200160002090503481600001819055508134038160010181905550338160020160016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008160020160006101000a81548160ff0219169083151502179055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050151561035557600080fd5b5b505050565b600060016000836000191660001916815260200190815260200160002060020160009054906101000a900460ff169050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080600080856040518082805190602001908083835b6020831015156103f157805182526020820191506020810190506020830392506103cc565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020925060016000846000191660001916815260200190815260200160002091506000826000015411158061045f57508160020160009054906101000a900460ff165b1561046d57600093506104d5565b816001015490508473ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505015156104b457600080fd5b60018260020160006101000a81548160ff0219169083151502179055508093505b50505092915050565b60006001600083600019166000191681526020019081526020016000206001015490509190505600a165627a7a72305820ecf06da1bc8f6749a8887db08a37406bce85e61179b5901ab6e675a2c4518b250029

   Swarm Source:
bzzr://ecf06da1bc8f6749a8887db08a37406bce85e61179b5901ab6e675a2c4518b25

 

View All
Block Age txn Difficulty GasUsed Reward
View All
Block Age UncleNumber Difficulty GasUsed Reward
Make sure to use the "downvote" button for any spammy posts, and the "upvote" for interesting conversations.