Skip to content

Commit

Permalink
Address Libby's feedback.
Browse files Browse the repository at this point in the history
  • Loading branch information
joelburget committed Jul 16, 2018
1 parent ec738a5 commit 8e1de11
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
13 changes: 3 additions & 10 deletions src/components/AnnotatedCode.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,22 +73,15 @@ const Description = styled.div`
`;

const NoteOuter = styled.div`
background-color: #ffffc6;
font-family: Consolas, Courier, monospace;
margin-left: 0;
padding: 5px 0;
`;

const NoteNote = styled.div`
background-color: white;
display: inline-block;
margin-right: 10px;
padding: 0 10px;
padding: 5px 0 5px 20px;
`;

function Note({ children }) {
return (
<NoteOuter>
<NoteNote>note</NoteNote>
{children}
</NoteOuter>
);
Expand All @@ -113,7 +106,7 @@ const pages = [
preDescription: (
<div>
<p>
In the initial version of our smart contract, the <code>transfer</code> function checks that the sender authorized the transfer (by signing the transaction sent to the blockchain) and that they have sufficient funds. It then updates both the sending (<code>from</code>) and receiving (<code>to</code>) account balances.
In the initial version of our smart contract, the <code>transfer</code> function checks that the sender authorized the transfer (the transaction sent to the blockchain was signed by the sender) and that they have sufficient funds. It then updates both the sending (<code>from</code>) and receiving (<code>to</code>) account balances.
</p>
<p>
Note that we start out with one property, using <code>row-enforced</code>. This states that the row indexed by <code>name</code> must have the keyset it contains (in its <code>ks</code> column) "enforced" in every possible code path. If the function's implementation enforces the keyset, the transaction will abort if it was not signed by "owner" of that row.
Expand Down
6 changes: 5 additions & 1 deletion src/pages/introducing-the-pact-property-checker/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ Like most smart contract languages, Pact is deterministic (so that the same code
(read users name))
```

Here you can think of the `admins` *keyset* as a pre-published list of the public keys for all administrators of the smart contract.
### Aside: keysets

Here you can think of the `admins` *keyset* as a pre-published list of administrators of the smart contract.

In general, a *keyset* is a set of users (public keys) authorized to perform some action. `enforce-keyset` checks that the current user matches a keyset. In this case we're checking that the user is an admin. One interesting feature of keysets in Pact is that they're first-class: they can be (e.g.) passed as arguments to a function or stored in the database.

## The state of smart contract security

Expand Down

0 comments on commit 8e1de11

Please sign in to comment.