Promissory Note
This is a smart legal clause that conforms to the Accord Project Template Specification, the protocol is managed by the open-source community of the Accord Project. The clause can be parsed and executed by the Cicero engine.
Description
This clause specifies how an interest bearing loan should be repaid.
This clause contains:
Running this clause
On your own machine
Download the Cicero template library
Unzip the library with your favourite tool
Then from the command-line, change the current directory to the folder containing this README.md file.
cd promissory-note
- With the Cicero command-line tool:
cicero execute --template ./ --dsl ./sample.txt --data ./data.json
Note, all of the command-line flags (like --template
) are optional.
Alternatively you can use the simpler command below if you want to use all of the default files.
cicero execute
Sample Payload Data
Request, as in data.json
{
"$class": "org.accordproject.promissorynote.Request",
"amountPaid": 100.50
}
For the request above, you should see the following response:
{
"$class": "org.accordproject.promissorynote.Response",
"outstandingBalance": 300.23
}
Testing this clause
This clause comes with an automated test that ensures that it executes correctly under different conditions. To test the clause, complete the following steps.
You need npm and node to test a clause. You can download both from here.
This clause was tested with Node v8.9.3 and NPM v5.6.0
From the promissory-note
directory.
- Install all of the dependencies.
npm install
- Run the tests
npm test
If successful, you should see the following output
dselman$ npm test
> promissory-note@0.0.1 test /Users/dselman/dev/cicero-template-library/promissory-note
> mocha
13:51:10 - info: Logging initialized. 2018-05-09T12:51:10.359Z
Logic
#PromissoryNote
✓ should execute a smart clause
1 passing (437ms)
Output above is abbreviated for clarity at ...
PROMISSORY NOTE
1000 USD 01/30/2018
FOR VALUE RECEIVED, the undersigned, "Daniel Selman", an individual residing at "1 Main Street" (“Maker”), hereby promises to pay to the order of "Clause", a CORP, having offices at "246 5th Ave, 3rd Fl, New York, NY 10001", or its successors and permitted assigns (“Lender” or the “Company”), the principal sum of 500 USD, plus any and all interest accrued thereon at the Note Rate (defined below), each due and payable in cash in lawful money of the United States on the dates and in the manner set forth in this Promissory Note (this “Note”).
1. Interest. The principal amount of this Note shall bear interest at 3.8% per annum (the “Note Rate”). Interest shall be computed on the basis of a three hundred and sixty-five (365) day year and charged for the actual number of days elapsed. Interest shall accrue on the original principal balance only and there shall be no accrual of interest upon interest.
2. Payment of Principal and Interest. The principal amount of this Note and the interest thereon shall be due and payable in full on the earlier of (a) 01/20/2019 or (b) ten (10) days prior to the Company filing an S-1 registration statement with the U.S. Securities and Exchange Commission in contemplation of an initial public offering (“IPO”). As used herein, IPO means the closing of a firm commitment underwritten public offering pursuant to a registration statement under the Securities Act of 1933, as amended.
4. Prepayment. The Maker may prepay any portion of the principal balance of this Note at any time without penalty.
6. Default. Each of the following shall constitute an event of default (“Event of Default”) under this Note:
(a) the Maker shall fail to pay when due (whether by acceleration or otherwise) principal or interest on this Note, and such default shall have continued for a period of 90 days;
(b) a proceeding (other than a proceeding commenced by the Maker) shall have been instituted in a court having jurisdiction seeking a decree or order for relief in respect of the Maker in an involuntary case under any applicable bankruptcy, insolvency or other similar law now or hereafter in effect, and such proceedings shall remain undismissed or unstayed and in effect for a period of 90 days (so long as the Maker is diligently proceeding to effect such dismissal or stay) or such court shall enter a decree or order granting the relief sought in such proceeding; or
(c) the Maker commences a voluntary case under any applicable bankruptcy, insolvency or other similar law now or hereafter in effect, consents to the entry of an order for relief in an involuntary case under any such law, or makes a general assignment for the benefit of creditors, or fails generally to pay his debts as they become due, or takes any action in furtherance of any of the foregoing.
7. Remedies. Upon the occurrence of any Event of Default, the Lender may, without notice or demand to the Maker, exercise any or all of the following remedies:
(a) declare all unpaid principal owing under this Note, together with all accrued and unpaid interest and other amounts owing hereunder, to be immediately due and payable without demand, protest, notice of protest, notice of default, presentment for payment or further notice of any kind; or
(b) proceed to enforce such other and additional rights and remedies as the Lender may be provided by applicable law.
9. Governing Law. This Note shall be governed by, and construed and enforced in accordance with, the internal laws (other than the choice of law principles thereof) of "New York, NY".
10. Waiver. No failure to exercise and no delay in exercising any right, power or privilege hereunder shall operate as a waiver thereof, nor shall any single or partial exercise of any right, power or privilege hereunder preclude any other or further exercise thereof or the exercise of any other right, power or privilege. The rights and remedies herein provided are cumulative and not exclusive of any rights or remedies provided by law.
11. Savings Clause. Notwithstanding any provision contained in this Note, the Lender shall not be entitled to receive, collect or apply as interest on this Note any amount in excess of the highest lawful rate permissible under any law which a court of competent jurisdiction may deem applicable hereto. If the Lender ever receives, collects or applies as interest any such excess, the amount that would be excessive interest shall be deemed to be a partial payment of principal and treated hereunder as such, and, if the principal balance of this Note is paid in full, any remaining excess shall promptly be paid to the Maker.
12. Amendment. This Note may be amended or modified only upon the written consent of both the Lender and the Maker. Any amendment must specifically state the provision or provisions to be amended and the manner in which such provision or provisions are to be amended.
13. Entire Agreement. This Note constitutes the entire agreement of the Maker and the Lender with respect to the subject matter hereof and supersedes all other prior arrangements, understandings, statements, representations and warranties, expressed or implied, and no oral statements or prior written statements not contained in this Note shall have any force and effect.
14. Counterparts. This Note may be executed in counterparts, each of which shall constitute an original and all of which shall constitute one and the same instrument.
15. Assignment. This Note may not be assigned and/or transferred in whole or in part by the Maker without the prior written consent of the Lender, which consent shall be in the Lender’s sole and absolute discretion. This Note may be assigned and/or transferred in whole or in part by the Lender at any time. The obligations of the Maker hereunder shall bind his heirs and permitted assigns, and all rights, benefits and privileges conferred on the Lender by this Note shall be and hereby are extended to, conferred upon, and may be enforced by, the successors and assigns of the Lender.
IN WITNESS WHEREOF, the Maker has executed this Note as of the date and year first above written.
This clause contains:
- *Some sample Clause Text* - [sample.txt](sample.txt)
- *A template* - [grammar/template.tem](grammar/template.tem)
- *A data model* - [models/model.cto](models/model.cto)
- *Contact logic* (in JavaScript) - [logic/logic.js](lib/logic.js)
## Running this clause
### On your own machine
1. [Download the Cicero template library](https://github.com/accordproject/cicero-template-library/archive/master.zip)
2. Unzip the library with your favourite tool
3. Then from the command-line, change the current directory to the folder containing this README.md file.
```
cd acceptance-of-delivery
```
4. With the [Cicero command-line tool](https://github.com/accordproject/cicero#installation):
```
cicero execute --template ./ --sample ./sample.txt --request ./request.json --state ./state.json
```
> Note, all of the command-line flags (like `--template`) are optional.
Alternatively you can use the simpler command below if you want to use all of the default files.
```
cicero execute
```
You should see the following output in your terminal:
```bash
mattmbp:acceptance-of-delivery matt$ cicero execute
18:22:38 - info: Logging initialized. 2018-05-15T22:22:38.131Z
18:22:38 - info: Using current directory as template folder
18:22:38 - info: Loading a default sample.txt file.
18:22:38 - info: Loading a single default request.json file.
18:22:38 - info: Loading a default state.json file.
18:22:38 - info: {"clause":"acceptance-of-delivery@0.0.3-e407ff0a315c5b1c267677edbda49a32d4e9ef890ad21a3e40b3bc110d06c88c","request":{"$class":"org.accordproject.acceptanceofdelivery.InspectDeliverable","deliverableReceivedAt":"January 1, 2018 16:34:00","inspectionPassed":true},"response":{"$class":"org.accordproject.acceptanceofdelivery.InspectionResponse","status":"OUTSIDE_INSPECTION_PERIOD","shipper":"resource:org.hyperledger.composer.system.Participant#Party%20A","receiver":"resource:org.hyperledger.composer.system.Participant#Party%20B","transactionId":"faacef8f-c0b2-4d9f-911f-007aa98a1c1d","timestamp":"2018-05-15T22:22:38.869Z"},"state":{"$class":"org.accordproject.common.ContractState","stateId":"org.accordproject.common.ContractState#1"},"emit":[]}
```
### Sample Payload Data
Request, as in [request.json](https://github.com/accordproject/cicero-template-library/blob/master/acceptance-of-delivery/request.json)
```json
{
"$class":"org.accordproject.acceptanceofdelivery.InspectDeliverable",
"deliverableReceivedAt": "January 1, 2018 16:34:00",
"inspectionPassed": true
}
```
For the request above, you should see the following response:
```json
{
"$class":"org.accordproject.acceptanceofdelivery.InspectionResponse",
"status":"OUTSIDE_INSPECTION_PERIOD",
"shipper":"resource:org.hyperledger.composer.system.Participant#Party%20A",
"receiver":"resource:org.hyperledger.composer.system.Participant#Party%20B",
"transactionId":"57df30ca-3755-457b-9176-5fae50dd3283",
"timestamp":"2018-02-17T21:49:40.206Z"
}
```
## Testing this clause
This clause comes with an automated test that ensures that it executes correctly under different conditions. To test the clause, complete the following steps.
You need npm and node to test a clause. You can download both from [here](https://nodejs.org/).
> This clause was tested with Node v8.9.3 and NPM v5.6.0
From the `acceptance-of-delivery` directory.
1. Install all of the dependencies.
```
npm install
```
2. Run the tests
```
npm test
```
If successful, you should see the following output
```
mattmbp:acceptance-of-delivery matt$ npm test
> acceptance-of-delivery@0.0.3 test /Users/matt/dev/accordproject/cicero-template-library/acceptance-of-delivery
> mocha
21:57:31 - info: Logging initialized. 2018-02-17T21:57:31.074Z
Logic
#InspectDeliverable
✓ passed inspection within time limit
✓ failed inspection within time limit
✓ inspection outside time limit
✓ inspection before delivable should throw
4 passing (458ms)
```