diff --git a/.cargo/config.toml b/.cargo/config.toml index 90410e20..a5ec25db 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,7 +1,7 @@ # paths = ["/path/to/override"] # path dependency overrides [alias] # command aliases -install_soroban = "install --git https://github.com/stellar/soroban-tools --rev cb3c44f9d8080917a7cb019d6be25019f6cf78c3 --root ./target soroban-cli --debug" +install_soroban = "install --git https://github.com/AhaLabs/soroban-tools --rev c7fb7e08ba8efa9828d9df863d991558f269e35b --root ./target soroban-cli --debug" b = "build --target wasm32-unknown-unknown --release" # c = "check" # t = "test" diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..f3c54b5f --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +package-lock.json linguist-generated=true -diff diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 0aacbff6..aa2f197f 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -26,14 +26,16 @@ jobs: - run: cargo install_soroban - uses: actions/setup-node@v3 with: - node-version: 18.x + node-version: 18.14.2 cache: 'npm' - run: | mkdir -p .soroban-example-dapp echo 'futurenet' > .soroban-example-dapp/network - echo 'CC757WDV3G442WQCNPNOA2UEXOC7UJD5VP4BLLCRDW5LRM6UZZR6ISVU' > .soroban-example-dapp/abundance_token_id - echo 'CCHCPXECLYGX4QU34ZZOHP6C6KVAPIDTUNPIUA6GF4SP6ECFF5BX57OG' > .soroban-example-dapp/crowdfund_id - echo 'Standalone Network ; February 2017' > .soroban-example-dapp/passphrase + echo 'CAU23MVDEW7VMB3AXC5PL5GZO3HBYZPEIP2P46X4T3AIC4Y7FXYZWES5' > .soroban-example-dapp/abundance_token_id + echo 'CDJPYH5HNGZ24SEWXFJOW6RXXHHNKU4XPCPBMB2VRTDPTMVPLYFQKZIE' > .soroban-example-dapp/crowdfund_id + echo 'Test SDF Future Network ; October 2022' > .soroban-example-dapp/passphrase echo 'https://rpc-futurenet.stellar.org/' > .soroban-example-dapp/rpc-url + echo '{"network":"futurenet","rpcUrl":"https://rpc-futurenet.stellar.org","networkPassphrase":"Test SDF Future Network ; October 2022"}' > shared/config.json + - run: npm ci - run: npm run build diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 19de7116..050583d4 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -5,9 +5,6 @@ on: branches: [main] pull_request: -env: - RUSTFLAGS: -Wclippy::all -Wclippy::pedantic - jobs: # complete: @@ -28,6 +25,7 @@ jobs: build-and-test: strategy: matrix: + rust: [msrv, latest] sys: - os: ubuntu-latest target: wasm32-unknown-unknown @@ -39,7 +37,21 @@ jobs: steps: - uses: actions/checkout@v3 - uses: stellar/actions/rust-cache@main + - name: Use the minimum supported Rust version + if: matrix.rust == 'msrv' + run: | + msrv="$(cargo metadata --format-version 1 --no-deps | jq -r '.packages | map(.rust_version) | map(values) | min')" + rustup override set $msrv + rustup component add clippy --toolchain $msrv + - name: Error on warnings and clippy checks + # Only error on warnings and checks for the msrv, because new versions of + # Rust will frequently add new warnings and checks. + if: matrix.rust == 'msrv' + run: echo RUSTFLAGS='-Wclippy::all -Wclippy::pedantic' >> $GITHUB_ENV + # TODO: Deny warnings when the warnings have been cleaned up. + # run: echo RUSTFLAGS='-Dwarnings -Wclippy::all -Wclippy::pedantic' >> $GITHUB_ENV - run: rustup update + - run: cargo version - run: rustup target add ${{ matrix.sys.target }} - run: cargo clippy --target ${{ matrix.sys.target }} --lib - if: matrix.sys.target != 'wasm32-unknown-unknown' diff --git a/.gitignore b/.gitignore index 47d52602..5c6985fe 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. /.soroban-example-dapp /.soroban +/shared/config.json # dependencies /node_modules /.pnp diff --git a/.nvmrc b/.nvmrc index 3c032078..72e4a483 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -18 +18.14.2 diff --git a/Cargo.lock b/Cargo.lock index 90949982..c765933f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -94,15 +94,6 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" -[[package]] -name = "block-buffer" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" -dependencies = [ - "generic-array", -] - [[package]] name = "block-buffer" version = "0.10.4" @@ -118,12 +109,6 @@ version = "3.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b1ce199063694f33ffb7dd4e0ee620741495c32833cde5aa08f02a0bf96f0c8" -[[package]] -name = "byteorder" -version = "1.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" - [[package]] name = "bytes-lit" version = "0.0.5" @@ -237,17 +222,32 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "3.2.0" +version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" +checksum = "622178105f911d937a42cdb140730ba4a3ed2becd8ae6ce39c7d28b5d75d4588" dependencies = [ - "byteorder", - "digest 0.9.0", - "rand_core 0.5.1", + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest", + "fiat-crypto", + "platforms", + "rustc_version", "subtle", "zeroize", ] +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83fdaf97f4804dcebfa5862639bc9ce4121e82140bec2a987ac5140294865b5b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.15", +] + [[package]] name = "cxx" version = "1.0.94" @@ -348,22 +348,13 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "digest" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" -dependencies = [ - "generic-array", -] - [[package]] name = "digest" version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "block-buffer 0.10.4", + "block-buffer", "const-oid", "crypto-common", "subtle", @@ -382,33 +373,34 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0997c976637b606099b9985693efa3581e84e41f5c11ba5255f88711058ad428" dependencies = [ "der", - "digest 0.10.7", + "digest", "elliptic-curve", "rfc6979", - "signature 2.1.0", + "signature", "spki", ] [[package]] name = "ed25519" -version = "1.5.3" +version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" +checksum = "60f6d271ca33075c88028be6f04d502853d63a5ece419d269c15315d4fc1cf1d" dependencies = [ - "signature 1.6.4", + "pkcs8", + "signature", ] [[package]] name = "ed25519-dalek" -version = "1.0.1" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" +checksum = "7277392b266383ef8396db7fdeb1e77b6c52fed775f5df15bb24f35b72156980" dependencies = [ "curve25519-dalek", "ed25519", - "rand", + "rand_core 0.6.4", "serde", - "sha2 0.9.9", + "sha2", "zeroize", ] @@ -426,7 +418,7 @@ checksum = "968405c8fdc9b3bf4df0a6638858cc0b52462836ab6b1c87377785dd09cf1c0b" dependencies = [ "base16ct", "crypto-bigint", - "digest 0.10.7", + "digest", "ff", "generic-array", "group", @@ -453,6 +445,12 @@ dependencies = [ "subtle", ] +[[package]] +name = "fiat-crypto" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0870c84016d4b481be5c9f323c24f65e31e901ae618f0e80f4308fb00de1d2d" + [[package]] name = "fnv" version = "1.0.7" @@ -532,7 +530,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "digest 0.10.7", + "digest", ] [[package]] @@ -582,12 +580,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e04e2fd2b8188ea827b32ef11de88377086d690286ab35747ef7f9bf3ccb590" -[[package]] -name = "intx" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f38a50a899dc47a6d0ed5508e7f601a2e34c3a85303514b5d137f3c10a0c75" - [[package]] name = "itertools" version = "0.10.5" @@ -622,8 +614,8 @@ dependencies = [ "ecdsa", "elliptic-curve", "once_cell", - "sha2 0.10.7", - "signature 2.1.0", + "sha2", + "signature", ] [[package]] @@ -693,13 +685,13 @@ dependencies = [ [[package]] name = "num-derive" -version = "0.3.3" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" +checksum = "9e6a0fd4f737c707bd9086cc16c925f294943eb62eb71499e9fd4cf71f8b9f4e" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.15", ] [[package]] @@ -736,12 +728,6 @@ version = "1.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" -[[package]] -name = "opaque-debug" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" - [[package]] name = "paste" version = "1.0.13" @@ -758,6 +744,12 @@ dependencies = [ "spki", ] +[[package]] +name = "platforms" +version = "3.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4503fa043bf02cee09a9582e9554b4c6403b2ef55e4612e96561d294419429f8" + [[package]] name = "ppv-lite86" version = "0.2.17" @@ -800,11 +792,22 @@ checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" dependencies = [ "getrandom 0.1.16", "libc", - "rand_chacha", + "rand_chacha 0.2.2", "rand_core 0.5.1", "rand_hc", ] +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + [[package]] name = "rand_chacha" version = "0.2.2" @@ -815,6 +818,16 @@ dependencies = [ "rand_core 0.5.1", ] +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + [[package]] name = "rand_core" version = "0.5.1" @@ -958,19 +971,6 @@ dependencies = [ "syn 2.0.15", ] -[[package]] -name = "sha2" -version = "0.9.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" -dependencies = [ - "block-buffer 0.9.0", - "cfg-if", - "cpufeatures", - "digest 0.9.0", - "opaque-debug", -] - [[package]] name = "sha2" version = "0.10.7" @@ -979,7 +979,7 @@ checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.7", + "digest", ] [[package]] @@ -988,23 +988,17 @@ version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" dependencies = [ - "digest 0.10.7", + "digest", "keccak", ] -[[package]] -name = "signature" -version = "1.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" - [[package]] name = "signature" version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500" dependencies = [ - "digest 0.10.7", + "digest", "rand_core 0.6.4", ] @@ -1018,21 +1012,20 @@ checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" name = "soroban-crowdfund-contract" version = "0.0.0" dependencies = [ - "rand", + "rand 0.7.3", "soroban-sdk", ] [[package]] name = "soroban-env-common" -version = "0.0.17" +version = "20.0.0-rc2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52e28d297d1172c2a020660728ac24ca3af7118de85ad547d071f96221111dfb" +checksum = "c2508a41765935d3bef43b2264667c4603725cf7ddd851321f1dc2b3bca8bb88" dependencies = [ "arbitrary", "crate-git-revision", "ethnum", "num-derive", - "num-integer", "num-traits", "serde", "soroban-env-macros", @@ -1043,9 +1036,9 @@ dependencies = [ [[package]] name = "soroban-env-guest" -version = "0.0.17" +version = "20.0.0-rc2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fbccdce4f74778cfe79e6ca8b6df2d094237d0bedf4aa167a73bfdaa7388fed" +checksum = "b41f1b3ebb747487ff9920822112a5816030e053734ed63c05f1a7db476f2768" dependencies = [ "soroban-env-common", "static_assertions", @@ -1053,23 +1046,20 @@ dependencies = [ [[package]] name = "soroban-env-host" -version = "0.0.17" +version = "20.0.0-rc2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35eef83232686c48fc8c8bfc560ee2e065bdd18ac31da8cb570e93f3fd78fea0" +checksum = "347fc729270de2fc8e312ba1872ef90fdc8dfcd0dacdd07a3bb7a038c41ea6d6" dependencies = [ "backtrace", - "curve25519-dalek", "ed25519-dalek", "getrandom 0.2.10", - "hex", "k256", - "log", "num-derive", "num-integer", "num-traits", - "rand", - "rand_chacha", - "sha2 0.9.9", + "rand 0.8.5", + "rand_chacha 0.3.1", + "sha2", "sha3", "soroban-env-common", "soroban-native-sdk-macros", @@ -1080,9 +1070,9 @@ dependencies = [ [[package]] name = "soroban-env-macros" -version = "0.0.17" +version = "20.0.0-rc2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97fcab4ca9be166587dd84939576634f2f7bccf213fe9f6aced9561ab4238be1" +checksum = "f16b7a75d77ae47143a07f92a35661c21e965f63bb4362d8491188a993687745" dependencies = [ "itertools", "proc-macro2", @@ -1091,14 +1081,13 @@ dependencies = [ "serde_json", "stellar-xdr", "syn 2.0.15", - "thiserror", ] [[package]] name = "soroban-ledger-snapshot" -version = "0.9.2" +version = "20.0.0-rc2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c379a73e5d14b0b9ba41157161c5362427a2ca75c936d1b737d41bca91ef252f" +checksum = "d202c5870aeec1cb97bfd06a94b8fe691c513ba6da8638deb07d8660e90056ba" dependencies = [ "serde", "serde_json", @@ -1109,9 +1098,9 @@ dependencies = [ [[package]] name = "soroban-native-sdk-macros" -version = "0.0.17" +version = "20.0.0-rc2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d891b456b0f6897ccbb8b67388ed7ce921fd47d19ff3ae8d8b1edca08339639" +checksum = "fe8cf96e5c9308347bc6fa0735d0591475a20b43ed00f96ad2df623bbe9c1e88" dependencies = [ "itertools", "proc-macro2", @@ -1121,15 +1110,15 @@ dependencies = [ [[package]] name = "soroban-sdk" -version = "0.9.2" +version = "20.0.0-rc2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1cf449f8c53d905ac41d4c264442f26aa559d4a0ef451569a7739bd4d747595" +checksum = "7d771d43a66ba0df14ff28ac1b37a6568da00afa12f28273a67fe92853ab28f8" dependencies = [ "arbitrary", "bytes-lit", "ctor", "ed25519-dalek", - "rand", + "rand 0.8.5", "soroban-env-guest", "soroban-env-host", "soroban-ledger-snapshot", @@ -1139,9 +1128,9 @@ dependencies = [ [[package]] name = "soroban-sdk-macros" -version = "0.9.2" +version = "20.0.0-rc2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b7ab0a02c265c41a44311e3e6271e0fccd518bda0c8383c7ff8aee478541d3b" +checksum = "bf5a6dd2e08217fdd75f3f849256dda2614badda9095df233a47c7c8f9783493" dependencies = [ "crate-git-revision", "darling", @@ -1149,7 +1138,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "sha2 0.9.9", + "sha2", "soroban-env-common", "soroban-spec", "soroban-spec-rust", @@ -1159,9 +1148,9 @@ dependencies = [ [[package]] name = "soroban-spec" -version = "0.9.2" +version = "20.0.0-rc2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adfd732ef1613e5ec919410fddd842d8cb804effb63c43acbf5ec6d77e6d0633" +checksum = "7e2a55aab81d7cd1df66f85de3d815fb08fc5fa412270dc374e031e27528c711" dependencies = [ "base64 0.13.1", "stellar-xdr", @@ -1171,14 +1160,14 @@ dependencies = [ [[package]] name = "soroban-spec-rust" -version = "0.9.2" +version = "20.0.0-rc2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fde0592863f1f34c1eff8bdbe35a6557adb6abadfc57804217fe035bec7421ef" +checksum = "1bcfa549d3362e6eafa3a51ad29d571f3dbae2cb9fe33d9f94c00a9f742f71df" dependencies = [ "prettyplease", "proc-macro2", "quote", - "sha2 0.9.9", + "sha2", "soroban-spec", "stellar-xdr", "syn 2.0.15", @@ -1187,20 +1176,19 @@ dependencies = [ [[package]] name = "soroban-token-sdk" -version = "0.9.2" +version = "20.0.0-rc2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38fabcf7f14b0a9b471d1663d3b29e32ca374a86dc8da6fe6536b5d3842def45" +checksum = "7294182d2197ac4da58163ca8f9c2e4df2045e5b81752928d82da9289ef366ee" dependencies = [ "soroban-sdk", ] [[package]] name = "soroban-wasmi" -version = "0.30.0-soroban" +version = "0.31.0-soroban1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c193640a103c4fc81163feca877bbea234dc20150015428ecc4e010f025f82bf" +checksum = "1b6e3e79c1f227ec98ea1e8fbf43d0267b9ca748616c9c8c0162fa2a8ca4d5d2" dependencies = [ - "intx", "smallvec", "spin", "wasmi_arena", @@ -1242,9 +1230,9 @@ dependencies = [ [[package]] name = "stellar-xdr" -version = "0.0.17" +version = "20.0.0-rc1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae197b4edde8835ab0ba018f1b5cdab0c47d0f28848f3f75d2951a1c9c7cdb48" +checksum = "e09a3734914a7427dbcd4f06b6dcd2b1cf38e934202f6abe4d73658f718b6113" dependencies = [ "arbitrary", "base64 0.13.1", @@ -1442,9 +1430,9 @@ checksum = "401c1f35e413fac1846d4843745589d9ec678977ab35a384db8ae7830525d468" [[package]] name = "wasmi_core" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624e6333e861ef49095d2d678b76ebf30b06bf37effca845be7e5b87c90071b7" +checksum = "dcf1a7db34bff95b85c261002720c00c3a6168256dcb93041d3fa2054d19856a" dependencies = [ "downcast-rs", "libm", @@ -1572,17 +1560,3 @@ name = "zeroize" version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" -dependencies = [ - "zeroize_derive", -] - -[[package]] -name = "zeroize_derive" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.15", -] diff --git a/Cargo.toml b/Cargo.toml index 3106b429..0ccfa126 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,6 +5,9 @@ members = [ "contracts/*", ] +[workspace.package] +rust-version = "1.74.0" + [profile.release] opt-level = "z" overflow-checks = true @@ -16,5 +19,5 @@ codegen-units = 1 lto = true [workspace.dependencies] -soroban-sdk = "0.9.2" -soroban-token-sdk = "0.9.2" +soroban-sdk = "20.0.0-rc2" +soroban-token-sdk = "20.0.0-rc2" diff --git a/Dockerfile b/Dockerfile index cadb8e4d..2c34eceb 100755 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ # Based on Preview 7 # https://soroban.stellar.org/docs/reference/releases -FROM ubuntu:20.04 +FROM ubuntu:22.04 RUN apt update && apt install -y curl diff --git a/README.md b/README.md index b9c85db3..114c31ab 100755 --- a/README.md +++ b/README.md @@ -11,21 +11,26 @@ Getting Started Install Dependencies -------------------- - -1. `soroban-cli`. See https://soroban.stellar.org/docs/getting-started/setup#install-the-soroban-cli, but instead of `cargo install soroban-cli`, run `cargo install_soroban`. This is an alias set up in [.cargo/config.toml](./.cargo/config.toml), which pins the local soroban-cli to a specific version. If you add `./target/bin/` [to your PATH](https://linuxize.com/post/how-to-add-directory-to-path-in-linux/), then you'll automatically use this version of `soroban-cli` when you're in this directory. -2. If you want to run everything locally: `docker` (you can run both Standalone and Futurenet backends with it) -3. Node.js v18 -4. [Freighter Wallet](https://www.freighter.app/) ≥[v5.0.2](https://github.com/stellar/freighter/releases/tag/2.9.1). Or from the Firefox / Chrome extension store. Once installed, enable "Experimental Mode" in the settings (gear icon). -5. If you want to run everything locally, build the `soroban-preview` docker image: +1. `rustc` >= 1.71.0 with the `wasm32-unknown-unknown` target installed. See https://soroban.stellar.org/docs/getting-started/setup#install-rust . If you have already a lower version, the easiest way to upgrade is to uninstall (`rustup self uninstall`) and install it again. +2. `soroban-cli`. See https://soroban.stellar.org/docs/getting-started/setup#install-the-soroban-cli, but instead of `cargo install soroban-cli`, run `cargo install_soroban`. This is an alias set up in [.cargo/config.toml](./.cargo/config.toml), which pins the local soroban-cli to a specific version. If you add `./target/bin/` [to your PATH](https://linuxize.com/post/how-to-add-directory-to-path-in-linux/), then you'll automatically use this version of `soroban-cli` when you're in this directory. +3. If you want to run everything locally: `docker` (you can run both Standalone and Futurenet backends with it) +4. Node.js v18 +5. [Freighter Wallet](https://www.freighter.app/) ≥[v5.0.2](https://github.com/stellar/freighter/releases/tag/2.9.1). Or from the Firefox / Chrome extension store. Once installed, enable "Experimental Mode" in the settings (gear icon). +6. If you want to skip step (1) and (2) and avoid installing specific `rustc` or `soroban-cli` versions, build the `soroban-preview` docker image: make build-docker - Building the docker image lets you avoid installing the specific version of soroban-cli in step (1), if desired. -6. **NOTE** - Follow the instructions below for Futurenet or Standalone and ensure that you have funded your wallet address that you intend to use from browser, otherwise the dapp display will be blank and a 'Account not found' will be printed on browser's console only. + +7. **NOTE** - Follow the instructions below for Futurenet or Standalone and ensure that you have funded your wallet address that you intend to use from browser, otherwise the dapp display will be blank and a 'Account not found' will be printed on browser's console only. Run Backend ----------- +Make sure to start from a clean setup: +``` +npm run clean +``` + You have three options: 1. Deploy on [Futurenet](https://soroban.stellar.org/docs/getting-started/deploy-to-futurenet) using a remote [RPC](https://soroban.stellar.org/docs/getting-started/run-rpc) endpoint, 2. Run your own Futerenet RPC node with Docker and deploy to it, 3. run in [localnet/standalone](https://soroban.stellar.org/docs/getting-started/deploy-to-a-local-network) mode. ### Option 1: Deploy on Futurenet diff --git a/components/molecules/deposits/index.tsx b/components/molecules/deposits/index.tsx index a42fb63b..bfd01b2d 100644 --- a/components/molecules/deposits/index.tsx +++ b/components/molecules/deposits/index.tsx @@ -2,21 +2,20 @@ import React from 'react' import styles from './style.module.css' import { Utils } from '../../../shared/utils' import { Spacer } from '../../atoms/spacer' -import { balance as getBalance } from 'crowdfund-contract' +import { crowdfund } from '../../../shared/contracts' export interface IDepositsProps { address: string decimals: number name?: string symbol?: string - idCrowdfund: string } export function Deposits(props: IDepositsProps) { const [balance, setBalance] = React.useState(BigInt(0)) React.useEffect(() => { - getBalance({ user: props.address }).then(setBalance) + crowdfund.balance({ user: props.address }).then(setBalance) }, [props.address]) diff --git a/components/molecules/form-pledge/index.tsx b/components/molecules/form-pledge/index.tsx index 22addf5b..6f394132 100644 --- a/components/molecules/form-pledge/index.tsx +++ b/components/molecules/form-pledge/index.tsx @@ -4,8 +4,7 @@ import { TransactionModal } from '../../molecules/transaction-modal' import { Utils } from '../../../shared/utils' import styles from './style.module.css' import { Spacer } from '../../atoms/spacer' -import { deposit } from 'crowdfund-contract' -import * as abundance from 'abundance-token' +import { abundance, crowdfund } from '../../../shared/contracts' export interface IFormPledgeProps { account: string @@ -29,14 +28,14 @@ function MintButton({ account, symbol, onComplete, decimals }: { decimals: numbe const [isSubmitting, setSubmitting] = useState(false) const displayAmount = 100 - const amount = BigInt(displayAmount * 10**decimals) + const amount = BigInt(displayAmount * 10 ** decimals) return (