
Custom purpose
The purpose of the contract is to act like a letter of credit. A letter of credit is a letter from a bank guaranteeing that a buyer's payment to a seller will be received on time and for the correct amount. In the event that the buyer is unable to make payment on the purchase, the bank will be required to cover the full or remaining amount of the purchase. This contract covers full value and the bank role is taken by the contract owner, which send the value ether along with the contract creation.
Parameters:
guarantor:_ the guarantor address; is the contract creator buyer the buyer address seller the seller address deadline the deadline in seconds/epoch value
Exposed methods
addEmployee adds new employee address
getBalance gets the contract balance value
getSellConfirmed gets if the sale went in good terms and payment was done
requestDeadlinePassed operates payment to seller, called by seller, in case sale was not in good terms
getDeadline gets the deadline
closeContract closes the contract, sending the balance value to the guarantor; only if deadlined passed and sell in good terms was confirmed
sellConfirmed sets the sale in good terms
Example
buyer_: "0x14723a09acff6d2a60dcdf7aa4aff308fddc160c"
seller_: "0x4b0897b0513fdc7c541b6d9d7e929c4e5364d2db"
deadline_: 1525506674
tx value_: 10 ether