From 9f2811cb468794eea6f96928de3e710a1a221e8c Mon Sep 17 00:00:00 2001 From: Omar Date: Fri, 1 Mar 2024 15:36:50 +0300 Subject: [PATCH] [Ignition]: Input sanitization. --- Cargo.lock | 158 ++++++++++++++++------------- packages/ignition/src/blueprint.rs | 6 ++ packages/ignition/src/errors.rs | 4 + tests/src/errors.rs | 5 + tests/tests/protocol.rs | 131 +++++++++++++++++++++++- 5 files changed, 231 insertions(+), 73 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0ba5e2e3..e0461d07 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -40,9 +40,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.12" +version = "0.6.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96b09b5178381e0874812a9b157f7fe84982617e48f71f4e3235482775e5b540" +checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" dependencies = [ "anstyle", "anstyle-parse", @@ -311,7 +311,7 @@ dependencies = [ "iana-time-zone", "num-traits", "serde", - "windows-targets 0.52.3", + "windows-targets 0.52.4", ] [[package]] @@ -345,7 +345,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -394,12 +394,12 @@ name = "common" version = "0.1.0" dependencies = [ "humantime", + "native-sdk", "radix-engine-common", "radix-engine-derive", "radix-engine-interface", "sbor", "scrypto", - "transaction", ] [[package]] @@ -443,9 +443,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.11" +version = "0.5.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "176dc175b78f56c0f321911d9c8eb2b77a78a4860b9c19db83835fea1a46649b" +checksum = "ab3db02a9c5b5121e1e42fbdb1aeb65f5e02624cc58c43f2884c6ccac0b82f95" dependencies = [ "crossbeam-utils", ] @@ -490,9 +490,9 @@ dependencies = [ [[package]] name = "cxx" -version = "1.0.117" +version = "1.0.118" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c15f3b597018782655a05d417f28bac009f6eb60f4b6703eb818998c1aaa16a" +checksum = "2673ca5ae28334544ec2a6b18ebe666c42a2650abfb48abbd532ed409a44be2b" dependencies = [ "cc", "cxxbridge-flags", @@ -502,9 +502,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.117" +version = "1.0.118" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81699747d109bba60bd6f87e7cb24b626824b8427b32f199b95c7faa06ee3dc9" +checksum = "9df46fe0eb43066a332586114174c449a62c25689f85a08f28fdcc8e12c380b9" dependencies = [ "cc", "codespan-reporting", @@ -512,24 +512,24 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] name = "cxxbridge-flags" -version = "1.0.117" +version = "1.0.118" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a7eb4c4fd18505f5a935f9c2ee77780350dcdb56da7cd037634e806141c5c43" +checksum = "886acf875df67811c11cd015506b3392b9e1820b1627af1a6f4e93ccdfc74d11" [[package]] name = "cxxbridge-macro" -version = "1.0.117" +version = "1.0.118" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d914fcc6452d133236ee067a9538be25ba6a644a450e1a6c617da84bf029854" +checksum = "1d151cc139c3080e07f448f93a1284577ab2283d2a44acd902c6fba9ec20b6de" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -553,7 +553,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.10.0", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -564,7 +564,20 @@ checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" dependencies = [ "darling_core", "quote", - "syn 2.0.51", + "syn 2.0.52", +] + +[[package]] +name = "defiplaza-v2-adapter-v1" +version = "0.1.0" +dependencies = [ + "common", + "ports-interface", + "radix-engine-interface", + "sbor", + "scrypto", + "scrypto-interface", + "transaction", ] [[package]] @@ -680,7 +693,7 @@ checksum = "311a6d2f1f9d60bff73d2c78a0af97ed27f79672f15c238192a5bbb64db56d00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -859,7 +872,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap 2.2.3", + "indexmap 2.2.5", "slab", "tokio", "tokio-util", @@ -892,9 +905,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "379dada1584ad501b383485dd706b8afb7a70fcbc7f4da7d780638a5a6124a60" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "hex" @@ -1054,9 +1067,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.3" +version = "2.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177" +checksum = "7b0b929d511467233429c45a44ac1dcaa21ba0f5ba11e4879e6ed28ddb4f9df4" dependencies = [ "equivalent", "hashbrown 0.14.3", @@ -1159,9 +1172,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.20" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] name = "memchr" @@ -1346,9 +1359,9 @@ checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "opaque-debug" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" [[package]] name = "openssl" @@ -1373,7 +1386,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -1415,7 +1428,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -2053,7 +2066,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -2182,7 +2195,7 @@ checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -2227,7 +2240,7 @@ dependencies = [ "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.2.3", + "indexmap 2.2.5", "serde", "serde_derive", "serde_json", @@ -2244,7 +2257,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -2404,9 +2417,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.51" +version = "2.0.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ab617d94515e94ae53b8406c628598680aa0c9587474ecbe58188f7b345d66c" +checksum = "b699d15b36d1f02c3e7c69f8ffef53de37aefae075d8488d4ba1a7788d574a07" dependencies = [ "proc-macro2", "quote", @@ -2448,9 +2461,9 @@ checksum = "7b2093cf4c8eb1e67749a6762251bc9cd836b6fc171623bd0a9d324d37af2417" [[package]] name = "tempfile" -version = "3.10.0" +version = "3.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a365e8cd18e44762ef95d87f284f4b5cd04107fec2ff3052bd6a3e6069669e67" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ "cfg-if", "fastrand", @@ -2473,6 +2486,7 @@ version = "0.1.0" dependencies = [ "caviarnine-v1-adapter-v1", "common", + "defiplaza-v2-adapter-v1", "extend", "flate2", "gateway-client", @@ -2510,7 +2524,7 @@ checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -2635,7 +2649,7 @@ version = "0.22.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c1b5fd4128cc8d3e0cb74d4ed9a9cc7c7284becd4df68f5f940e1ad123606f6" dependencies = [ - "indexmap 2.2.3", + "indexmap 2.2.5", "serde", "serde_spanned", "toml_datetime", @@ -2865,7 +2879,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", "wasm-bindgen-shared", ] @@ -2899,7 +2913,7 @@ checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -3015,7 +3029,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9dbe55c8f9d0dbd25d9447a5a889ff90c0cc3feaa7395310d3d826b2c703eaab" dependencies = [ "bitflags 2.4.2", - "indexmap 2.2.3", + "indexmap 2.2.5", "semver", ] @@ -3085,7 +3099,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.3", + "windows-targets 0.52.4", ] [[package]] @@ -3103,7 +3117,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.3", + "windows-targets 0.52.4", ] [[package]] @@ -3123,17 +3137,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.3" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d380ba1dc7187569a8a9e91ed34b8ccfc33123bbacb8c0aed2d1ad7f3ef2dc5f" +checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" dependencies = [ - "windows_aarch64_gnullvm 0.52.3", - "windows_aarch64_msvc 0.52.3", - "windows_i686_gnu 0.52.3", - "windows_i686_msvc 0.52.3", - "windows_x86_64_gnu 0.52.3", - "windows_x86_64_gnullvm 0.52.3", - "windows_x86_64_msvc 0.52.3", + "windows_aarch64_gnullvm 0.52.4", + "windows_aarch64_msvc 0.52.4", + "windows_i686_gnu 0.52.4", + "windows_i686_msvc 0.52.4", + "windows_x86_64_gnu 0.52.4", + "windows_x86_64_gnullvm 0.52.4", + "windows_x86_64_msvc 0.52.4", ] [[package]] @@ -3144,9 +3158,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.3" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68e5dcfb9413f53afd9c8f86e56a7b4d86d9a2fa26090ea2dc9e40fba56c6ec6" +checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" [[package]] name = "windows_aarch64_msvc" @@ -3156,9 +3170,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.3" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dab469ebbc45798319e69eebf92308e541ce46760b49b18c6b3fe5e8965b30f" +checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" [[package]] name = "windows_i686_gnu" @@ -3168,9 +3182,9 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.3" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a4e9b6a7cac734a8b4138a4e1044eac3404d8326b6c0f939276560687a033fb" +checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" [[package]] name = "windows_i686_msvc" @@ -3180,9 +3194,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.3" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b0ec9c422ca95ff34a78755cfa6ad4a51371da2a5ace67500cf7ca5f232c58" +checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" [[package]] name = "windows_x86_64_gnu" @@ -3192,9 +3206,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.3" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "704131571ba93e89d7cd43482277d6632589b18ecf4468f591fbae0a8b101614" +checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" [[package]] name = "windows_x86_64_gnullvm" @@ -3204,9 +3218,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.3" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42079295511643151e98d61c38c0acc444e52dd42ab456f7ccfd5152e8ecf21c" +checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" [[package]] name = "windows_x86_64_msvc" @@ -3216,15 +3230,15 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.3" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0770833d60a970638e989b3fa9fd2bb1aaadcf88963d1659fd7d9990196ed2d6" +checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" [[package]] name = "winnow" -version = "0.6.2" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a4191c47f15cc3ec71fcb4913cb83d58def65dd3787610213c649283b5ce178" +checksum = "dffa400e67ed5a4dd237983829e66475f0a4a26938c4b04c21baede6262215b8" dependencies = [ "memchr", ] @@ -3262,5 +3276,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] diff --git a/packages/ignition/src/blueprint.rs b/packages/ignition/src/blueprint.rs index 96b3ec7d..6f1cb30f 100644 --- a/packages/ignition/src/blueprint.rs +++ b/packages/ignition/src/blueprint.rs @@ -1545,6 +1545,7 @@ mod ignition { /// * `value`: [`i64`] - The maximum allowed staleness period in /// seconds. pub fn set_maximum_allowed_price_staleness(&mut self, value: i64) { + assert!(value >= 0, "{}", INVALID_MAXIMUM_PRICE_STALENESS); self.maximum_allowed_price_staleness = value } @@ -1576,6 +1577,11 @@ mod ignition { lockup_period: LockupPeriod, percentage: Decimal, ) { + assert!( + percentage >= Decimal::ZERO, + "{}", + INVALID_UPFRONT_REWARD_PERCENTAGE + ); self.reward_rates.insert(lockup_period, percentage) } diff --git a/packages/ignition/src/errors.rs b/packages/ignition/src/errors.rs index 8d424313..a2cc439c 100644 --- a/packages/ignition/src/errors.rs +++ b/packages/ignition/src/errors.rs @@ -54,4 +54,8 @@ define_error! { BOTH_POOL_ASSETS_ARE_THE_PROTOCOL_RESOURCE => "The user resource can not be the protocol resource."; OVERFLOW_ERROR => "Overflow error"; + INVALID_MAXIMUM_PRICE_STALENESS + => "Price staleness must be a positive or zero integer"; + INVALID_UPFRONT_REWARD_PERCENTAGE + => "Upfront rewards must be positive or zero decimals"; } diff --git a/tests/src/errors.rs b/tests/src/errors.rs index 7ec32ccf..21b787be 100644 --- a/tests/src/errors.rs +++ b/tests/src/errors.rs @@ -49,6 +49,7 @@ define_error_checking_functions! { ignition => [ NO_ADAPTER_FOUND_FOR_POOL_ERROR, NEITHER_POOL_RESOURCE_IS_PROTOCOL_RESOURCE_ERROR, + NEITHER_POOL_RESOURCE_IS_USER_RESOURCE_ERROR, NO_ASSOCIATED_VAULT_ERROR, NO_ASSOCIATED_LIQUIDITY_RECEIPT_VAULT_ERROR, NOT_AN_IGNITION_ADDRESS_ERROR, @@ -66,6 +67,10 @@ define_error_checking_functions! { LIQUIDITY_POSITION_HAS_NOT_MATURED_ERROR, USER_MUST_NOT_PROVIDE_PROTOCOL_ASSET_ERROR, USER_RESOURCES_VOLATILITY_UNKNOWN_ERROR, + BOTH_POOL_ASSETS_ARE_THE_PROTOCOL_RESOURCE, + OVERFLOW_ERROR, + INVALID_MAXIMUM_PRICE_STALENESS, + INVALID_UPFRONT_REWARD_PERCENTAGE, ], ociswap_adapter => [ FAILED_TO_GET_RESOURCE_ADDRESSES_ERROR, diff --git a/tests/tests/protocol.rs b/tests/tests/protocol.rs index 0720f8d6..6ab80614 100644 --- a/tests/tests/protocol.rs +++ b/tests/tests/protocol.rs @@ -38,6 +38,135 @@ fn cant_open_a_liquidity_position_when_opening_is_disabled( Ok(()) } +#[test] +fn cant_add_a_negative_upfront_reward_percentage() -> Result<(), RuntimeError> { + // Arrange + let Environment { + environment: ref mut env, + mut protocol, + .. + } = ScryptoTestEnv::new()?; + + // Act + let rtn = protocol.ignition.add_reward_rate( + LockupPeriod::from_seconds(1), + dec!(-1), + env, + ); + + // Assert + assert_is_ignition_invalid_upfront_reward_percentage(&rtn); + + Ok(()) +} + +#[test] +fn can_add_a_zero_upfront_reward_percentage() -> Result<(), RuntimeError> { + // Arrange + let Environment { + environment: ref mut env, + mut protocol, + .. + } = ScryptoTestEnv::new()?; + + // Act + let rtn = protocol.ignition.add_reward_rate( + LockupPeriod::from_seconds(1), + dec!(0), + env, + ); + + // Assert + assert!(rtn.is_ok()); + + Ok(()) +} + +#[test] +fn can_add_a_positive_upfront_reward_percentage() -> Result<(), RuntimeError> { + // Arrange + let Environment { + environment: ref mut env, + mut protocol, + .. + } = ScryptoTestEnv::new()?; + + // Act + let rtn = protocol.ignition.add_reward_rate( + LockupPeriod::from_seconds(1), + dec!(1), + env, + ); + + // Assert + assert!(rtn.is_ok()); + + Ok(()) +} + +#[test] +fn cant_set_the_maximum_allowed_price_staleness_to_a_negative_number( +) -> Result<(), RuntimeError> { + // Arrange + let Environment { + environment: ref mut env, + mut protocol, + .. + } = ScryptoTestEnv::new()?; + + // Act + let rtn = protocol + .ignition + .set_maximum_allowed_price_staleness(-1, env); + + // Assert + assert_is_ignition_invalid_maximum_price_staleness(&rtn); + + Ok(()) +} + +#[test] +fn can_set_the_maximum_allowed_price_staleness_to_zero( +) -> Result<(), RuntimeError> { + // Arrange + let Environment { + environment: ref mut env, + mut protocol, + .. + } = ScryptoTestEnv::new()?; + + // Act + let rtn = protocol + .ignition + .set_maximum_allowed_price_staleness(0, env); + + // Assert + assert!(rtn.is_ok()); + + Ok(()) +} + +#[test] +fn can_set_the_maximum_allowed_price_staleness_to_a_positive_number( +) -> Result<(), RuntimeError> { + // Arrange + let Environment { + environment: ref mut env, + mut protocol, + .. + } = ScryptoTestEnv::new()?; + + // Act + let rtn = protocol + .ignition + .set_maximum_allowed_price_staleness(1, env); + + // Assert + assert!(rtn.is_ok()); + + Ok(()) +} + #[test] fn cant_open_a_liquidity_position_on_a_pool_that_has_no_adapter( ) -> Result<(), RuntimeError> { @@ -601,8 +730,8 @@ fn cant_add_an_allowed_pool_where_neither_of_the_resources_is_the_protocol_resou let fungible2 = ResourceBuilder::new_fungible(OwnerRole::None) .mint_initial_supply(100, env)?; let (pool, ..) = OciswapV2PoolInterfaceScryptoTestStub::instantiate( - fungible2.resource_address(env)?, fungible1.resource_address(env)?, + fungible2.resource_address(env)?, pdec!(1), dec!(0.03), dec!(0.03),