Skip to content

Commit 3959f7d

Browse files
virgil-serbanutabmmoore
authored andcommitted
Readme file for IELE examples and misspelling fixes. (#48)
1 parent 8032d01 commit 3959f7d

File tree

6 files changed

+55
-11
lines changed

6 files changed

+55
-11
lines changed

iele-examples/README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Iele examples
2+
3+
## Structure
4+
5+
* **erc20.iele**: Implements the ERC-20 token standard.
6+
* **forwarder.iele**: Implements a forwarder that forwards any funds sent to
7+
the account it is deployed with to the account that created it.
8+
* **forwardingWallet-copycreate.iele**: Showcases the dynamic contract creation
9+
feature of IELE. Implements a wallet that can serve deposit and withdrawal
10+
requests as well as setup new accounts that forward funds sent to them to
11+
this wallet.
12+
* **forwardingWallet.iele**: Showcases the dynamic contract creation
13+
feature of IELE. Implements a forwarder that forwards any funds sent to
14+
its account to the account that created it.
15+
* **simpleOpenAuction.iele**: Implements a simple open auction.
16+
17+
## Running the tests
18+
19+
To run all the tests, one can always do
20+
```sh
21+
make test
22+
```
23+
24+
However, to run only the tests involving the examples above, run
25+
26+
```sh
27+
make
28+
29+
# erc20.iele
30+
for f in `ls tests/iele/ERC20`; do echo $f; ./blockchaintest tests/iele/ERC20/$f || break; done
31+
32+
# forwarder.iele and forwardingWallet-copycreate.iele
33+
./blockchaintest tests/iele/forwarder/copycreate.iele.json
34+
35+
# forwarder.iele and forwardingWallet.iele
36+
./blockchaintest tests/iele/forwarder/create.iele.json
37+
38+
# simpleOpenAuction.iele
39+
for f in `ls tests/iele/auction`; do echo $f; ./blockchaintest tests/iele/auction/$f || break; done
40+
```
41+
42+
## Correctness proofs
43+
44+
Will be available soon.

iele-examples/erc20.iele

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ contract ERC20 {
1313
// The account storage is divided into two regions:
1414
// - the balance region maps each account address to its balance
1515
// - the allowance region maps each pair of owner and spender accounts to the
16-
// allownce that the owner approves to be transferred by the spender
16+
// allowance that the owner approves to be transferred by the spender
1717
// Account storage keys that correspond to each of the regions use different
1818
// bit prefixes as follows
1919
@balanceRegion = 1
@@ -65,7 +65,7 @@ define @log.Approval(%owner, %spender, %allowance) {
6565
store %allowance, %logCell
6666

6767
// log an approval event, where the owner approves the allowance value to be
68-
// transfered by the spender
68+
// transferred by the spender
6969
log %logCell, @approvalEvent, %owner, %spender
7070
ret void
7171
}

iele-examples/forwarder.iele

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) 2017 Runtime Verification, Inc. All Rights Reserved.
22
//
33
// This contract implements a forwarder that forwards any funds sent to
4-
// the account it is deployed with to the acoount that created it.
4+
// the account it is deployed with to the account that created it.
55
contract Forwarder {
66

77
// initializes a forwarder by storing in the account storage the account

iele-examples/forwardingWallet-copycreate.iele

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// Copyright (c) 2017 Runtime Verification, Inc. All Rights Reserved.
22
//
33
// This example showcases the dynamic contract creation feature of IELE. The
4-
// Wallet contract can dynamically create acounts and deploy a full copy of a
5-
// contract already deployed in an exisiting account. The deployed code is not
4+
// Wallet contract can dynamically create accounts and deploy a full copy of a
5+
// contract already deployed in an existing account. The deployed code is not
66
// statically known but it is not dynamically generated either.
77

88
// This contract implements a wallet that can serve deposit and withdrawal
@@ -20,8 +20,8 @@ contract Wallet {
2020
sstore %owner, 0
2121
sstore %forwarder, 1
2222
}
23-
24-
// deposits the sent value to the wallet account's balance
23+
24+
// deposits the sent value to the wallet account's balance
2525
define public @deposit() {}
2626

2727
// withdraws amount equal to %value from the wallet and sends it to the

iele-examples/forwardingWallet.iele

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// Copyright (c) 2017 Runtime Verification, Inc. All Rights Reserved.
22
//
33
// This examples showcases the dynamic contract creation feature of IELE. The
4-
// Wallet contract can dynamically create acounts with the Forwarder contract
4+
// Wallet contract can dynamically create accounts with the Forwarder contract
55
// deployed, since the code for the Forwarder contract is statically available.
66

77
// This contract implements a forwarder that forwards any funds sent to
8-
// the account it is deployed with to the acoount that created it.
8+
// the account it is deployed with to the account that created it.
99
contract Forwarder {
1010

1111
// initializes a forwarded by storing in the account storage the account
@@ -16,7 +16,7 @@ contract Forwarder {
1616
sstore %parent, 0
1717
}
1818

19-
// deposit forwards the recieved funds to the creator of this account
19+
// deposit forwards the received funds to the creator of this account
2020
define public @deposit() {
2121
// get the received funds
2222
%value = call @iele.callvalue()

iele-examples/simpleOpenAuction.iele

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ contract SimpleOpenAuction {
2727
@highest.bid = 4
2828

2929
// set to 1 after the auction has been settled (the auction end time has passed and
30-
// the benficiary has received the final highest bid, set to 0 otherwise
30+
// the beneficiary has received the final highest bid, set to 0 otherwise
3131
@settled = 5
3232

3333
// initializes an auction with the given beneficiary and bidding time duration

0 commit comments

Comments
 (0)