Skip to content

Instantly share code, notes, and snippets.


Created Sep 11, 2017
What would you like to do?
Created using browser-solidity: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at
pragma solidity ^0.4.0;
contract Sample {
mapping(address => address) arr;
uint8 limit;
function Sample(uint8 _limit) {
limit = _limit;
//i am the sender. if my balance > limit this receiver can take my 1 ether
function Accept(address _receiver){
arr[msg.sender] = _receiver;
//i am the receiver and the sender gave me 1 ether. i wants to receive it.
function Take(address sender){
if(msg.sender != arr[sender])
if(sender.balance < limit)
//how can contract send 1 ether from sender to receiver(msg.sender)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment