EscrowFoundry Contract: assisted escrow service

ETHAppsETHApps Member Posts: 11
EscrowFoundry: 0xbe7193779e3239781e49faafbdd0a9efa938f389
https://etherscan.io/address/0xbe7193779e3239781e49faafbdd0a9efa938f389
https://etherchain.org/account/0xbe7193779e3239781e49faafbdd0a9efa938f389
https://live.ether.camp/account/be7193779e3239781e49faafbdd0a9efa938f389

EscrowFoundry can be used to generate a custom escrow contract to protect any transaction or agreement. The create function generate the contract and returns its address:

create(address _buyer, address _seller, address _escrow, uint256 _amount, uint8 _percent_fee, uint8 _percent_tip, uint256 _dispute_limit)

_buyer: address of the buyer.
_seller: address of the seller.
_escrow: address of the escrow.
_amount: transaction amount.
_percent_fee: escrow fee (only in case of dispute), as percent of amount (0% - 100%).
_percent_tip: tip for the developer, as percent of amount (0% - 100%)
_dispute_limit: maximum time allowed for the escrow to resolve a dispute.

Once an EscrowContract is created, any address (usually the buyer, but anyone can contribute) can send money to it in order to reach the required balance (i.e. amount + fee + tip). Any extra balance is added to developer tip. EscrowContract has following attributes:

buyer(): address of the buyer.
seller(): address of the seller.
escrow(): address of the escrow.
amount(): transaction amount.
fee(): escrow fee (only in case of dispute).
tip(): tip for the developer.
dispute_end(): deadline for the escrow to resolve a dispute (if any).
status(): current contract status (Funding, Paid, Accepted, Dispute, Closed).
CurrentStatus(s): event triggered when status change.

Once the required balance is reached, following actions are available:

buyer_cancel(): the buyer can cancel the contract anytime before buyer has accepted. Amount + fee + tip is refunded to buyer.
seller_accept(): once the contract is fully funded the seller needs to accept it in order to proceed.
buyer_pay(): if there's no issue the buyer can release payment to the seller. The escrow fee is refunded to buyer.
dispute(): in case of issues both buyer and seller can open a dispute.
resolve(percent_buyer, percent_tip): escrow can resolve the dispute assigning a specified percent of the amount to the buyer (the rest automatically goes to the seller). Escrow can also send an additional tip to developer (subtracted from his fee).
fifty_fifty(): once the deadline for escrow is expired, both buyer and seller can decide to split the amount evenly (escrow fee is returned to buyer).

EscrowFoundry interface:

[{"constant":true,"inputs":[{"name":"_buyer","type":"address"},{"name":"_seller","type":"address"},{"name":"_escrow","type":"address"},{"name":"_amount","type":"uint256"},{"name":"_percent_fee","type":"uint8"},{"name":"_percent_tip","type":"uint8"},{"name":"_dispute_limit","type":"uint256"}],"name":"create","outputs":[{"name":"","type":"address"}],"type":"function"},{"inputs":[],"type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"a","type":"address"}],"name":"NewContract","type":"event"}]

EscrowContract interface:

[{"constant":true,"inputs":[],"name":"seller","outputs":[{"name":"","type":"address"}],"type":"function"},{"constant":true,"inputs":[],"name":"dispute_end","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":true,"inputs":[],"name":"status","outputs":[{"name":"","type":"uint8"}],"type":"function"},{"constant":true,"inputs":[],"name":"tip","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":false,"inputs":[{"name":"percent_buyer","type":"uint8"},{"name":"percent_tip","type":"uint8"}],"name":"resolve","outputs":[],"type":"function"},{"constant":false,"inputs":[],"name":"seller_accept","outputs":[],"type":"function"},{"constant":false,"inputs":[],"name":"fifty_fifty","outputs":[],"type":"function"},{"constant":true,"inputs":[],"name":"buyer","outputs":[{"name":"","type":"address"}],"type":"function"},{"constant":true,"inputs":[],"name":"amount","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":false,"inputs":[],"name":"buyer_pay","outputs":[],"type":"function"},{"constant":true,"inputs":[],"name":"fee","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":true,"inputs":[],"name":"escrow","outputs":[{"name":"","type":"address"}],"type":"function"},{"constant":false,"inputs":[],"name":"buyer_cancel","outputs":[],"type":"function"},{"constant":false,"inputs":[],"name":"dispute","outputs":[],"type":"function"},{"inputs":[{"name":"_developer","type":"address"},{"name":"_buyer","type":"address"},{"name":"_seller","type":"address"},{"name":"_escrow","type":"address"},{"name":"_amount","type":"uint256"},{"name":"_fee","type":"uint256"},{"name":"_tip","type":"uint256"},{"name":"_dispute_limit","type":"uint256"}],"type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"s","type":"uint8"}],"name":"CurrentStatus","type":"event"}]

Enjoy! :)

Comments

Sign In or Register to comment.