Skip to content

Commit b1bbb4b

Browse files
authored
Solana Firedrill (#6)
1 parent a12fcda commit b1bbb4b

File tree

96 files changed

+11200
-318
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+11200
-318
lines changed

.tool-versions

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
rust 1.81.0
2+
golang 1.22.0

chains/solana/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
contracts/target
2+
contracts/docker-target

chains/solana/Makefile

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
BIN_DIR = bin
2+
export GOPATH ?= $(shell go env GOPATH)
3+
export GO111MODULE ?= on
4+
export ANCHOR_VERSION ?=v0.29.0
5+
export ANCHOR_IMAGE ?= backpackapp/build:$(ANCHOR_VERSION)
6+
export ANCHOR_BUILD_ARGS ?=
7+
# Allow overriding the output directory for docker builds
8+
TARGET_DIR ?= $(PWD)/contracts/target
9+
10+
.PHONY: projectserum_version
11+
anchor_version:
12+
@echo "${ANCHOR_VERSION}"
13+
14+
.PHONY: clippy
15+
clippy:
16+
cd ./contracts && cargo clippy -- -D warnings
17+
18+
.PHONY: gomods
19+
gomods: ## Install gomods
20+
go install github.com/jmank88/gomods@v0.1.3
21+
22+
.PHONY: gomodtidy
23+
gomodtidy: gomods
24+
gomods tidy
25+
26+
.PHONY: format-contracts
27+
format-contracts:
28+
cd ./contracts && cargo fmt && go fmt ./...
29+
30+
.PHONY: rust-tests
31+
rust-tests:
32+
cd ./contracts && cargo test
33+
34+
.PHONY: lint-go
35+
lint-go:
36+
golangci-lint --max-issues-per-linter 0 --max-same-issues 0 --color=always --exclude=dot-imports --timeout 15m --out-format checkstyle:golangci-lint-report.xml run
37+
38+
.PHONY: lint-go-fix
39+
lint-go-fix:
40+
golangci-lint --max-issues-per-linter 0 --max-same-issues 0 --color=always --exclude=dot-imports --timeout 15m run --verbose --fix
41+
42+
.PHONY: anchor-go-gen
43+
anchor-go-gen:
44+
rm -rf ./gobindings && cd ./contracts && anchor build && cd .. && ./scripts/anchor-go-gen.sh
45+
46+
.PHONY: rematch-ids
47+
rematch-ids:
48+
./scripts/rematch-ids.sh
49+
50+
.PHONY: reclaim-sol
51+
reclaim-sol:
52+
./scripts/reclaim-sol.sh
53+
54+
.PHONY: format
55+
format:
56+
go fmt ./... && cd ./contracts && cargo fmt
57+
58+
.PHONY: go-tests
59+
go-tests:
60+
go test -v ./... -json -covermode=atomic -coverpkg=./... -coverprofile=integration_coverage.txt 2>&1 | tee /tmp/gotest.log | gotestloghelper -ci=true -singlepackage=true -hidepassingtests=false -hidepassinglogs=false
61+
62+
.PHONY: build-contracts
63+
build-contracts:
64+
cd ./contracts && anchor build
65+
66+
# Note on CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
67+
# Sparse index significantly speeds up dependency fetching, supposedly default in 1.70 but anchor build was still using a slow git download
68+
.PHONY: docker-build-contracts
69+
docker-build-contracts:
70+
docker run --rm \
71+
-v $(shell pwd)/contracts:/workdir \
72+
-v ${TARGET_DIR}:/workdir/target \
73+
-e CARGO_TARGET_DIR=/workdir/target \
74+
-e CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse \
75+
${ANCHOR_IMAGE} anchor build ${ANCHOR_BUILD_ARGS}
76+
77+
.PHONY: docker-update-contracts
78+
docker-update-contracts:
79+
docker run --rm \
80+
-v $(shell pwd)/contracts:/workdir \
81+
-v ${TARGET_DIR}:/workdir/target \
82+
-e CARGO_TARGET_DIR=/workdir/target \
83+
-e CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse \
84+
${ANCHOR_IMAGE} anchor keys sync
85+
86+
.PHONY: solana-checks
87+
solana-checks: clippy anchor-go-gen format gomodtidy lint-go rust-tests go-tests build-contracts
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
[toolchain]
2+
anchor_version = "0.29.0"
3+
4+
[features]
5+
seeds = false
6+
skip-lint = false
7+
8+
[programs.devnet]
9+
failing_receiver = "Dri11EwVRViqqkjs7SWV3d3ejcanBGMNrcGhD6HVn756"
10+
firedrill_compound = "Dri11NnBPbx85w8a47ZXBZa3Hi7E2xvHAA9Xpyk7UivQ"
11+
firedrill_entrypoint = "Dri11c6TXJXELaZUgQtyw3doxbn7bGXQ6z5LRZ8bMPbc"
12+
firedrill_feequoter = "3d1KhA6K2L6pbzpuhYGHTcsj1B4f3r86wJRE81brYTQW"
13+
firedrill_offramp = "Dri11kiWR5f1oTn5NLm3wmfaDq3cYauR92wrsTxNaudt"
14+
firedrill_token = "Dri11r4S1hY8iMpxNh6UoYZ9hsGgmGUUyZ3zxUb2rpc2"
15+
16+
[registry]
17+
url = "https://api.apr.dev"
18+
19+
[provider]
20+
cluster = "Devnet"
21+
wallet = "/Users/bukata/.config/solana/id.json"
22+
23+
[scripts]
24+
test = "yarn run ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"

0 commit comments

Comments
 (0)