Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
contracts
migrations Add counter examples in Solidity and Rust Nov 12, 2018
test Update for web3c 2.0 (#23) Feb 20, 2019
.gitignore
LICENSE
README.md Update for web3c 2.0 (#23) Feb 20, 2019
Xargo.toml
package.json Update package.json (#25) Feb 22, 2019
truffle-box.json
truffle-config.js

README.md

oasis-box

A truffle box to support compiling, migrating, and testing both Solidity and Rust contracts with or without confidentiality in the Oasis cloud.

Installation

Note: It's suggested to use the Contract Kit docker image so that you can skip installation and take advantage of complete Truffle integration with Oasis. Currently in development is support for a Truffle workflow with Rust contracts outside of Contract Kit. In the meantine, if you're using Truffle to develop Rust contracts, we'll assume you're using Contract Kit.

If you're using Solidity outside of Contract Kit, ensure you have truffle v5 installed. If you have another version of truffle installed you'll want to either uninstall it or ensure you're using v5 with this box.

npm install -g truffle

Now download the truffle box.

truffle unbox oasislabs/oasis-box

Using oasis-box

Once installed, you can use truffle commands like you would any other truffle project. However, you'll want to make sure you're pointing at an Oasis gateway, for example, by specifying --network oasis. The supported commands are

  • truffle compile
  • truffle migrate --network oasis
  • truffle test --network oasis.

To mark your contract confidential, prefix your contract's filename with either confidential_ or confidential-*, for example, confidential_MyContract.sol for Solidity or confidential-my-contract-crate for Rust. When your contract compiles with one of the above truffle commands, its bytecode will be prepended with a header indicating that it should be deployed as a confidential contract. On deploy, the header indicates to the Oasis runtime that the contract is to be run inside a secure enclave, at which point one should use web3c.js to communicate with the contract through an encrypted channel.

To do this, simply retrieve the contract's deploy address from the artifact, and instantiate a web3c.js Contract object with it. For example,

const MyContract = artifacts.require("MyContract");
const contractInstance = web3c.oasis.Contract(MyContract.abi, MyContract.address, { ... });

For more details, see the truffle and web3c.js documentation.

You can’t perform that action at this time.