diff options
| author | Boris Verkhovskiy <boris.verk@gmail.com> | 2024-04-03 02:30:27 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-03 02:30:27 -0700 |
| commit | 6d87022050ffbd5d818781427329c5362e3df197 (patch) | |
| tree | 3809b2b1a7790d8b30e6d694c575eb68f02f661c /vyper.html.markdown | |
| parent | c76b8f690a577d9ff89947d79c36a96a7c3b4deb (diff) | |
| parent | e8dabf3c1955e1a458e8bc936587ad59772a9c33 (diff) | |
Merge branch 'master' into patch-1
Diffstat (limited to 'vyper.html.markdown')
| -rw-r--r-- | vyper.html.markdown | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/vyper.html.markdown b/vyper.html.markdown index fec1a79f..bad0c31e 100644 --- a/vyper.html.markdown +++ b/vyper.html.markdown @@ -181,7 +181,7 @@ def _changeTaskStatus( \ _status: uint256, \ ): # backslashes (\) allow for multi-line code - # Natspec comments are particularly helpful for documentation and readibility + # Natspec comments are particularly helpful for documentation and readability # Natspec can be included using familiar Pythonic docstring syntax """ @notice @@ -429,16 +429,16 @@ struct Struct: owner: address _balance: uint256 # balance is a reserved keyword, is a member for addresses -exampleStuct: Struct +exampleStruct: Struct @public def foo() -> uint256: - self.exampleStuct = Struct({owner: msg.sender, _balance: 5}) - self.exampleStuct._balance = 10 - self.exampleStuct._balance = 5 # set to new value - clear(self.exampleStuct._balance) - clear(self.exampleStuct) - return self.exampleStuct._balance + self.exampleStruct = Struct({owner: msg.sender, _balance: 5}) + self.exampleStruct._balance = 10 + self.exampleStruct._balance = 5 # set to new value + clear(self.exampleStruct._balance) + clear(self.exampleStruct) + return self.exampleStruct._balance # Data locations: Memory vs. storage vs. calldata - all complex types (arrays, @@ -510,7 +510,7 @@ def increment(x: uint256, y: uint256) -> (uint256, uint256): y += 1 return (x, y) -# Call previous functon +# Call previous function @public @constant def willCall() -> (uint256, uint256): @@ -679,7 +679,7 @@ sha3(concat("ab", "cd")) # returns bytes32 # Step 1. Commit # Place a commitment by sending output of `sha3()` -sha3("a secret"); # btyes32 commit +sha3("a secret"); # bytes32 commit sha3(concat("secret", "other secret", "salt")); # commit multiple things # The `sha3()` calculation should occur off-chain, only the bytes32 # output should be inputted into some `commit()` function |
