This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as Peps from "../Peps" | |
let sdk = new Peps.SDK("https://awsapi.wpeps.com", "wss://awsws.wpeps.com") | |
let clear: Uint8Array | |
// Alice shares a resource with bob | |
sdk.login("alice", "password").then(function (session) { | |
return session.ResourceAPI.create(["alice", "bob"], "my/resource", clear) | |
}).then(function({id, content}){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import stdlib.themes.bootstrap | |
database int /counter = 0; | |
function action(_) { | |
/counter++; | |
#msg = <div>Thank you, user {/counter}!</div> | |
} | |
function page() { | |
<span id="msg">Welcome</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.10; | |
contract TestCounter { | |
// public automatically creates the getter | |
int256 public count = 0; | |
function increment() public { | |
count += 1; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
modifier onlyOwner() { | |
require(msg.sender == owner); | |
_; | |
} | |
function transferOwner(address _owner) public onlyOwner { | |
owner = _owner; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
modifier postCondition() { | |
_; | |
require(expr); | |
} |
OlderNewer