-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #150 from freespek/igor/contract-setup
fixing the CI + workflow for deploying contracts to testnet
- Loading branch information
Showing
24 changed files
with
518 additions
and
413 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: Deployment to testnet | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
# This cron expression triggers the workflow at 8:00 UTC every day | ||
- cron: "8 0 * * *" | ||
# uncomment to debug in a PR | ||
#pull_request: | ||
|
||
jobs: | ||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
# see: https://github.com/stellar/soroban-examples/blob/main/.github/workflows/rust.yml | ||
- uses: stellar/actions/rust-cache@main | ||
# pin the rust version: https://github.com/stellar/rs-soroban-sdk/pull/1353 | ||
- run: | | ||
rustup default 1.81.0 | ||
rustup update | ||
- run: cargo version | ||
- uses: stellar/stellar-cli@main | ||
with: | ||
version: 22.0.0 | ||
|
||
- run: stellar --version | ||
|
||
- name: Generate Soroban keys | ||
run: | | ||
stellar keys generate --global alice --network testnet --fund | ||
stellar keys generate --global bob --network testnet --fund | ||
stellar keys generate --global admin --network testnet --fund | ||
- name: Build contract examples | ||
run: | | ||
cd ContractExamples | ||
rustup target add wasm32-unknown-unknown | ||
# it's important to disable reference types, otherwise we get deployment errors | ||
RUSTFLAGS="-C target-feature=-reference-types" cargo build --target wasm32-unknown-unknown --release | ||
- name: Deploy alert | ||
run: | | ||
cd ContractExamples | ||
./scripts/alert-deploy.sh | ||
- name: Deploy setter | ||
run: | | ||
cd ContractExamples | ||
./scripts/setter-populate.sh | ||
- name: Deploy timelock | ||
run: | | ||
cd ContractExamples | ||
./scripts/prepare-timelock.sh | ||
- name: Deploy xycloans | ||
run: | | ||
cd ContractExamples | ||
./scripts/xycloans-populate.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
diff --git a/Cargo.toml b/Cargo.toml | ||
index e3a7104..b18672f 100644 | ||
--- a/Cargo.toml | ||
+++ b/Cargo.toml | ||
@@ -3,11 +3,11 @@ resolver = "2" | ||
members = [ | ||
#"flash-loan", | ||
#"receiver-standard", | ||
+ "pool", | ||
+ "factory", | ||
"examples/simple", | ||
#"vault", | ||
#"vault-interface", | ||
- "factory", | ||
- "pool" | ||
] | ||
|
||
[profile.release-with-logs] | ||
@@ -26,8 +26,8 @@ lto = true | ||
|
||
|
||
[workspace.dependencies.soroban-sdk] | ||
-version = "20.0.0" | ||
+version = "22.0.0-rc.3" | ||
|
||
|
||
[workspace.dependencies.fixed-point-math] | ||
-version = "0.0.2" | ||
\ No newline at end of file | ||
+version = "0.0.2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/examples/simple/src/lib.rs b/examples/simple/src/lib.rs | ||
index 021a924..c75abb1 100644 | ||
--- a/examples/simple/src/lib.rs | ||
+++ b/examples/simple/src/lib.rs | ||
@@ -48,7 +48,7 @@ impl FlashLoanReceiver for FlashLoanReceiverContract { | ||
.get::<DataKey, i128>(&DataKey::Amount) | ||
.unwrap(); | ||
|
||
- let total_amount = borrowed + compute_fee(&borrowed); | ||
+ let total_amount = borrowed + compute_fee(&borrowed) + 1; | ||
|
||
let flash_loan = e | ||
.storage() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env bash | ||
|
||
# see: https://github.com/stellar/rs-soroban-sdk/pull/1353 | ||
rustc --version | grep 1.81.0 || (echo "Run: rustup default 1.81.0"; exit 1) | ||
|
||
dir=$(cd `dirname $0`; pwd -P) | ||
cd ${dir}/.. | ||
|
||
# build our contracts and soroban-examples | ||
stellar contract build | ||
|
||
# build xycloans | ||
cd ${dir}/../xycloans | ||
patch --forward -p1 <../patches/xycloans.diff || (echo "patch already applied?") | ||
patch --forward -p1 <../patches/xycloans2.diff || (echo "patch already applied?") | ||
|
||
stellar contract build | ||
|
||
cd ${dir} | ||
|
||
# When using rust over 1.81.0: | ||
#RUSTFLAGS="-C target-feature=-reference-types" cargo build --target wasm32-unknown-unknown --release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.