Skip to content

sarcophagus-org/sarcophagus-contracts

Repository files navigation

Sarcophagus Core

Discord Twitter

Sarcophagus is a decentralized dead man's switch built on Ethereum and Arweave.

Overview

This repository contains the smart contracts (and corresponding deployment scripts) that power the Sarcophagus system.

Configuration

To work with the contracts you'll need to set some configuration values:

$ cp .env.example .env

Then open up .env and edit as you see fit. The default values are fine for local development.

If you're going to be deploying to public blockchain networks (testnets, or mainnet), you need to enter a private key into the corresponding <NETWORK>_PK environment variable (starting with 0x). Make sure this key has some ETH, to pay for the transaction fees! Also enter a URL for an ethereum provider into the <NETWORK>_PROVIDER environment variable.

Next, install the project's dependencies

$ npm install

Finally, you'll need to compile the contracts

$ npm run compile

Now you're all set up for doing local development or deploying the contracts to a public network.

Local Development

"Running" the project consists of spinning up a local blockchain and deploying the contracts to that blockchain.

Once you've done that, you'll be able to use any Ethereum wallet to connect to your local blockchain and interact with those contracts.

Start a local blockchain via

$ npm run develop

and then within the new Truffle Console, deploy the contracts by typing migrate

truffle(develop)> migrate

In your console output you'll see both the Sarcophagus (Mock) Token and the Sarcopahgus contract being deployed, their transaction hashes, and their addresses.

Testing

To run the tests, run

$ npm run test

Deployment

Deployments ("migrations") happen via truffle.

To deploy to the Goerli testnet, execute

$ npx truffle migrate --network goerli

To deploy to the Mainnet, execute

$ npx truffle migrate --network mainnet

Note: be sure to set your deployer private key, and provider, in .env

To deploy to other networks, add the relevant network block into truffle-config.js and execute

$ npx truffle migrate --network <yourNewNetwork>

Public Deployments

The contracts are currently deployed on public networks. Please refer to the deployed directory for details.

Additional Tips

If you make changes to the contracts, re-compile before executing any of the above commands:

$ npm run compile

In addition, If you're running on a local development environment (via npm run develop), you'll want to stop and restart it to reflect the changes.

Community

Discord Twitter

We can also be found on Telegram.

Made with 💀 and proudly decentralized.

About

Smart contracts for the Sarcophagus Dead Man's Switch system

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published