Below, you'll find a simple walkthrough to get started using Āut's Smart Contracts.
Create docker network (once)
docker network create mainnet
Run local blockchain node & deploy contracts.
Now the local node is accessable at http://localhost:8545
(with chainId=31337
)
The deployer's PK is specified in dev.env
docker-compose up --build
Run local graph node
docker-compose -f docker-compose.graph.yml up
Deploy subgraphs
(
cd subgraphs
yarn create-local
yarn deploy-local
)
Here's a simple description of each contract and its function in our contracts suite.
The core contract of the protocol. All participants are required to go through the AutID
contract to create an account and join hubs.
Globally-defined variables used across the protocol. Variables of note are period0Start
, periodDuration
, constraintFactor
, and penaltyFactor
.
Central point of hubs where the hub implementation is stored and new hubs are created.
Each hub can register an X.hub
domain, as registered through this contract.
Where all taskIds
are registered, to be used within a Contribution
.
Stores values related to the hub like admins and hub parameters. Each hub is connected to a unique TaskFactory
, TaskManager
, ParticipationScore
, and Membership
contract.
Location for hub admins to create Contributions
and register Descriptions
.
Contract where Contributions
are managed through creation and removal. Members can commit to a Contribution
, and are then given the Contribution
.
Here, you can find the hub members, their role and commitment level for the Hub
.
Hub member participation scores and performance are stored within ParticipationScore.sol
.
Foundryup is the Foundry toolchain installer. You can find more about it here.
Open your terminal and run the following command:
curl -L https://foundry.paradigm.xyz | bash
This will install Foundryup, then simply follow the instructions on-screen,
which will make the foundryup
command available in your CLI.
Running foundryup
by itself will install the latest (nightly) precompiled binaries: forge
, cast
, anvil
, and chisel
.
See foundryup --help
for more options, like installing from a specific version or commit.
forge script ./script/DeployAll.s.sol --rpc-url $RPC_URL --etherscan-api-key $XSCAN_TOKEN --private-key $DEPLOYER_PRIVATE_KEY --verify --broadcast
Simulate the deployment locally first by running the command without the --broadcast
(and --verify
) flag.
$RPC_URL
replace with the desired EVM RPC. Private RPC recommended. (Alchemy, Infura etc.)
$XSCAN_TOKEN
network specific blockchain explorer API key, use to upload ABIs and verify contracts
$DEPLOYER_PRIVATE_KEY
The private key of the deploying account (needs to have sufficient gas token balance)
forge build
Now all artefacts are stored in the out/
folder (repository root)
Foundry
forge b #build
forge t #test
forge fmt #format
forge help