Skip to content

unicrowio/contracts

Repository files navigation

Unicrow Contracts and Interfaces

The map below might be useful to get quick bearings

Contracts Map

Note: To make the map reasonably orderly, only the most significant relationships are displayed

Basic Setup and Types

To install the packages:

yarn install

To generate the types and compile the contracts with the new ABI:

yarn hardhat compile

To get local rpc accounts:

yarn hardhat accounts

To get the configured safe account:

yarn hardhat safe

Setup RPC Locally

Run ganache server to run a local RPC:

yarn hardhat node --no-deploy

Deploy the Contracts

Setup environment variables:

cp .env.example .env
KEY VALUE
GNOSIS_SAFE_ADDRESS Governance address multisig
MNEMONIC Account of one of the Gnosis Safe owners
SAFE_SERVICE_URL Gnosis safe service url (to submit tx proposals)
UNICROW_FEE Unicrow fee (in bips)

Deploy the Unicrow contracts with your local rpc:

yarn deploy:local

Deploy the Unicrow contracts on Arbitrum One (via the Gnosis Safe):

yarn deploy:arbitrum

Interact using a console

It is recommended running the tests (see below) to test interactions with the contracts, but it is possible to do it using the console too by running a console instance first and then attaching an address.

Open the console:

yarn hardhat console --network development

Initiate a contract:

let unicrow = ethers.getContractFactory("Unicrow") // Replace "Unicrow" for a name of any other contract
unicrow = await unicrow.attach("address_of_the_contract_here"); // address you got during the deployment

Call the contract function:

await unicrow.pay({ paramters }) 

Tests

Run the tests locally:

yarn hardhat test --network localhost

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published