Multiparty Agreement

This is how you can Create and Certify your Multiparty Agreement on the SIGN Smart Contract

MULTIPARTY AGREEMENT

createAgreement(hash: String, title: String, stringifiedJSON: String, counterParts: String, signerPubKey: String, uuid: String)

Call this function with the correct arguments in the correct order where: hash: is a String and represents the hash of a document where a Multiparty Agreement creator wrote the details of an agreement. It should be 64 bytes (characters) max.

title: is a string and represents the reference of an Agreement, this is limited to 64 bytes (characters) max.

stringifiedJSON: is a string containing a json object that includes the creator property (empty) and up to 6 addressX properties, it also include other data like the title, hash or timestamp:

{ title: fileRef, timestamp: timestamp, hash: fileHash, creator: "", address1: "", address2: "", address3: "", address4: "", address5: "", address6: "" } The creator property has to be empty, the value will be written by the smart contract with the invocation caller address.

counterParts: is a string with all counterparts waves addresses separated by a comma ",", maximum 6 counterparts.

signerPubKey: is a String that represents the public key of an account signing the invocation calling this method.

To get the public key using waves signer in your webapp you simply need to get it with: document.signer._userData.publicKey

uuid: is a String and represents a unique identifiant for your certification, this has to be generated by a uuid library, SIGN webapp is using the uuid library, if the uuid is already used by another record on the dApp's storage you will receive the "This uuid already exist" error, this is to avoid collision.

SIGN AGREEMENT

signAgreement(hash, agreementId, signerPubKey)

This is how you can Sign a Multiparty Agreement on the SIGN Smart Contract after receiving a Signature reques. You simply have to call this function with the correct arguments in the correct order where: hash: is a String and represents the hash of a document where a Multiparty Agreement creator wrote the details of an agreement. It should be 64 bytes (characters) max. agreementId: is a String and represents the transaction ID of the transaction that created the agreement.

signerPubKey: is a String that represents the public key an account signing the invocation calling this method.

To get the public key using waves signer in your webapp you simply need to get it with: document.signer._userData.publicKey

Last updated