SendERC with PaySpec

SendERC is a new Dapp + standard protocol that aims to give merchants a simple, universal invoicing system for tokens. It is open source, ownerless, trustless, and arbitrary with no fees. Like everything I make!

The following is a smart contract which facilitates the creation of invoices and allows users to pay the invoices. Here are the methods and their parameters:

  • function createInvoice( string memory description, uint256 nonce, address token, uint256 amountDue, address payTo, uint256 ethBlockExpiresAt ) public returns (uint uuid);

  • function payInvoice( bytes32 invoiceUUID, address from) public returns (bool);

  • function invoiceWasPaid( bytes32 invoiceUUID ) public view returns (bool);

These three very simple but powerful methods are the basis for the entire invoicing system. You will see the contract deployed on the Ropsten network here:

Plans for a Dapp are underway that will make interacting with this contract much easier through metamask. Additionally, the ‘invoice show’ page will display a QR code which, when scanned by Metamask Mobile, will immediately prompt the user to call the ‘payInvoice’ method using that invoice UUID and their current metamask account address as the input parameters.

The merchant will run open-source NodeJS software, a bot, which will poll the ethereum network to detect when the invoice has been paid. Once it has been paid, that bot will trigger events on the merchant’s web server and return an API that shows the invoice data.