JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q54225F
  • License GPL-3.0-only

Otterspace’s EIP-4973-compliant non-transferable badge protocol helps DAOs create better incentive systems, automate permissions and enable non-financialized governance

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@otterspace-xyz/contracts) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    otterspace-contracts

    unit tests

    Otterspace’s EIP-4973-compliant non-transferable badge protocol helps DAOs create better incentive systems, automate permissions and enable non-financialized governance ✨ 🦦 🚀


    Project setup

    • Install Foundry
    • Requires Node v16 and Solidity 0.8.7
    git clone git@github.com:otterspace-xyz/otterspace-contracts.git
    git submodule update --init
    yarn
    forge install
    forge build
    forge test
    npx hardhat typechain
    npx hardhat test

    Live contracts on Optimism:


    Live contracts on Goerli:

    Use ABIs with JavaScript

    We're publishing this repository at @otterspace-xyz/contracts

    npm i @otterspace-xyz/contracts

    With node >= 16, contract ABIs can be imported into JavaScript applications as npm dependencies as follows:

    Badges ABI

    import Badges from '@otterspace-xyz/contracts/out/Badges.sol/Badges.json' assert { type: 'json' }

    Raft ABI

    import Raft from '@otterspace-xyz/contracts/out/Raft.sol/Raft.json' assert { type: 'json' }

    We're exporting specific .sol files using the "files" property in package.json. Please familiarize yourself with the .sol files we're exporting by looking into package.json.


    Tech Stack

    We use Foundry and Hardhat together. With this setup we get:

    • Unit tests written in Solidity (Forge)
    • Integration tests written in JavaScript (Mocha)

    Foundry

    Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.

    Foundry consists of:

    • Forge: Ethereum testing framework (like Truffle, Hardhat and DappTools).
    • Cast: Swiss army knife for interacting with EVM smart contracts, sending transactions and getting chain data.
    • Anvil: local Ethereum node, akin to Ganache, Hardhat Network.

    Need help getting started with Foundry? Read the 📖 Foundry Book!

    Hardhat

    Hardhat is an Ethereum development environment for professionals. It facilitates performing frequent tasks, such as running tests, automatically checking code for mistakes or interacting with a smart contract.

    On Hardhat's website you will find:

    Deploying and verifying the contract

    • create a .env file matching the variables seen in .env.example
    • run ./scripts/deployProxy.ts .env
    • Hardhat will deploy the SpecDataHolder, Raft, and Badges contracts, then deploy a proxy for each one.
    • Once deployed, follow the logged instructions in your terminal to verify the contracts.
    • VERY IMPORTANT: call setBadgesAddress on the SpecDataHolder contract. Without this, it won't work.

    Foundry setup for VS Code Users

    Add a .vscode file under the root

    {
      "solidity.packageDefaultDependenciesContractsDirectory": "src",
      "solidity.packageDefaultDependenciesDirectory": "lib",
      "solidity.compileUsingRemoteVersion": "v0.8.7"
    }

    Changelog

    See changelog.md file.

    Checklist for bumping version

    • update "version" in package.json
    • re-deploy contracts
    • update contract addresses in readme (if necessary)
    • update changelog

    License

    See LICENSE file.