Smart contract exposing recent participant ids in the Spark network.
Contract deployed at 0xffac3d46e0adfd7806c454b23c3c74d95e09bb02
.
Get all recent participants.
Owner only. Set participants for given date (0-30).
This repo requires Rust and Cargo, which can be installed from here
We recommend you install it from source:
git clone https://github.com/foundry-rs/foundry
cd foundry
git checkout 9a4bb7f5
# install cast + forge
cargo install --path ./cli --profile local --bins --locked --force
# install anvil
cargo install --path ./anvil --profile local --locked --force
git clone https://github.com/filecoin-station/spark-impact-evaluator.git
cd spark-impact-evaluator
git submodule update --init --recursive
forge test
import * as SparkEvaluationsRecentParticipants from '@filecoin-station/spark-evaluations-recent-participants'
console.log({
abi: SparkEvaluationsRecentParticipants.ABI,
address: SparkEvaluationsRecentParticipants.ADDRESS
})
The deployment relies on contract bindings generated in the /contract-bindings
directory. If you make changes to the contracts, run:
rm -rf contract-bindings
forge bind --crate-name contract-bindings -b ./contract-bindings
This will create new bindings with the modified contracts.
Deployment can then proceed either with a locally stored mnemonic or a connected
ethereum ledger wallet. To use with a mnemonic, create a secrets/mnemonic
file
in the root directory.
To deploy, run:
(cd contract-utils && cargo run)
Integration tests run on the filecoin calibration net and require a wallet with test FIL to pay for gas fees on the calibration net. Test FIL is free and can be obtained using the faucet.
Before running integration tests, these env vars are required:
export TEST_RPC_URL=https://api.calibration.node.glif.io/rpc/v1
export TEST_MNEMONIC={insert wallet mnemonic here}
export TEST_CONTRACT_ADDRESS={this can be an empty string}
To run tests, run:
cd contract-utils
cargo test -- --nocapture --test-threads 1