@organigram/protocol
v0.1.5
Published
Smart contract framework for building incorruptible organizations.
Readme
Organigram Protocol
The Organigram Protocol is a Solidity framework for building incorruptible governance systems on Ethereum.
By assembling three simple concepts, it allows for the automated execution of any business rules in a decentralized and auditable manner:
- Assets are what is being governed: they represent value in cryptocurrency - either native assets (such as ETH), stablecoins (such as USDC or EurE), or any other types of ERC-20-compatible tokens.
- Organs are cryptographic vaults: they store the permissions defining who can access what assets. They can only be modified by procedures stored in the organ's internal memory.
- Procedures are automated, pre-approved workflows that allow permitted users to perform actions in a compliant and safe way (for example transfer assets or edit permissions after a vote).
For comprehensive documentation, please visit our official website.
Installation
Install the NPM package with:
# npm:
npm install @organigram/protocol
# pnpm:
pnpm add @organigram/protocolUsage
With this package, you can directly interact with the Organigram Protocol smart contracts in your Solidity and JavaScript code, or use our official clients to build your own applications on top of the protocol.
Import contract sources in your solidity code:
import "@organigram/protocol/Organ.sol";Import contracts artifacts in your JS code:
import OrganContractABI from '@organigram/protocol/abi/Organ.sol/Organ.json' with { type: 'json' } import { getContract, type Abi } from 'viem' const contract = getContract({ address: getAddress(address as Address), abi: OrganContractABI.abi as Abi, client: { // ... viem client configuration } })Use the official JavaScript/TypeScript client:
pnpm add @organigram/jsimport { OrganigramClient, Organigram, Organ } from '@organigram/js' const organigramClient = await OrganigramClient.load({ publicClient: { // ... viem public client configuration } walletClient: { // ... viem wallet client configuration } })Import as components with the official React client:
pnpm add @organigram/reactimport { Diagram } from '@organigram/react' import { Organigram } from '@organigram/js' const OrganigramComponent = () => <Diagram organigram={new Organigram()} />
Development
Install Foundry
This package uses Foundry (Forge/Anvil) for local development. Install the Foundry toolchain with:
curl -L https://foundry.paradigm.xyz | bash
foundryupStart local node
Start a Sepolia fork for local development with Anvil:
pnpm anvilCompile contracts
Compile the contracts with:
pnpm buildDeploy contracts
Deploy protocol contracts to a list of networks:
pnpm deploy:protocol <comma-separated list of network names or chain ids>Requires a .env with MNEMONIC and NEXT_PUBLIC_THIRDWEB_CLIENT_ID. The deployer account must have enough funds on each target network to cover deployment costs.
For example:
pnpm deploy:protocol mainnet,base,11155111To deploy to the local Anvil fork:
pnpm deploy:protocol anvilBy default, network RPC URLs are built from Thirdweb. You can override a specific network with RPC_URL_<chain id>, or RPC_URL_<network name>, for example RPC_URL_11155111.
The deployment script will also accept an optional --resume flag to resume the last run if the deployment has failed.
Contributing
We are looking for Solidity developers and testers to keep our contracts secure and up-to-date. Please create issues in our Github page, fork and create Pull-Requests, or contact us on our Discord or at [email protected].
