I'd like to develop a simple Escrow smart contract.

It will designate 3 parties, the buyer, seller and arbiter. A simple use case would be...

The buyer doesn't trust that the seller will send an item through the post, so they use an Escrow smart contract to aid the transaction.

The buyer locks 3 EOS into a smart contract, in which he can only then release the funds to the seller or raise a dispute, engaging the arbiter to take an action.

Should the seller honour the deal, the buyer simply releases the funds.

I have an old example of this written in Solidity.

contract Escrow {

address public buyer; 
address public seller; 
address public arbiter;

function Escrow(address _seller, address _arbiter){
    buyer = msg.sender;
    seller = _seller;
    arbiter = _arbiter;

function() payable {


modifier onlyBuyerAndArbiter() { if (msg.sender == buyer || msg.sender == arbiter) _;}
modifier onlySellerAndArbiter() { if (msg.sender == seller || msg.sender == arbiter) _;}

function payoutToSeller() onlyBuyerAndArbiter returns (bool){
        return true;

function refundToBuyer() onlySellerAndArbiter returns (bool){
        return true;

function getBalance() constant returns (uint){
    return this.balance;


I know a similar thing can be achieved by simply creating a multisig account but what if I want to employ further logic like the transaction must be done by a certain time?

  • Also keen to find an answer :) How'd you go with this @John?
    – Dom V
    Jul 10, 2018 at 7:48
  • @DomV Learnt a lot since asking this question, looks like the way to go is set up listening for eosio.token::transfer actions which then keeps a record as to how much someone has sent to the account. Then one can just set up a withdraw action on the contract which has conditions before it would allow the receiver to get the money. I'd love to write a simple contract showing it off however haven't the time at the moment. Definitely on the to do list though. Aug 23, 2018 at 22:56
  • John. Can you share the code of a simple escrow EOS contract? Of course, if you did it. Sep 15, 2018 at 15:04

2 Answers 2


Check out the code here. Bond contract developed by EOSMETAL is opensource. https://github.com/EOSMetal/tungsten


This can be done within an EOS Smart Contract, I'd suggest finding some tutorials and understanding how it works. NSJames has 3 on youtube which are pretty good

  1. 01 - Setting up a Virtual Machine and EOSIO for smart contract development
  2. 02 - Basic EOSIO smart contract schema, structs, actions and persisting to the blockchain
  3. 03 - Diving deeper into EOSIO Smart Contracts: Typedefs, Assertions and Singletons

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.