Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
4f20ed6
flake update
thedavidmeister Oct 8, 2025
4079205
foundry lock
thedavidmeister Oct 8, 2025
cf14748
update deps
thedavidmeister Oct 8, 2025
08e1c4e
wip on size
thedavidmeister Oct 9, 2025
4d74e5d
wip on size
thedavidmeister Oct 9, 2025
0d1220d
wip on contract size
thedavidmeister Oct 9, 2025
7538faf
fix tests
thedavidmeister Oct 9, 2025
8437bbf
bump int
thedavidmeister Oct 10, 2025
d2d6371
interpreter
thedavidmeister Oct 10, 2025
185f17e
fix tests
thedavidmeister Oct 10, 2025
2361a34
Merge branch 'main' into 2025-10-08-int
thedavidmeister Oct 10, 2025
77c8968
lint
thedavidmeister Oct 10, 2025
c4ee0e3
Merge branch '2025-10-08-int' of github.com:rainlanguage/rain.orderbo…
thedavidmeister Oct 10, 2025
0b1726a
pointers
thedavidmeister Oct 10, 2025
22d65bd
formatting test fixes
0xgleb Oct 10, 2025
8054b0a
fix static
thedavidmeister Oct 10, 2025
1ed2018
Merge branch '2025-10-08-int' of github.com:rainlanguage/rain.orderbo…
thedavidmeister Oct 10, 2025
546fae5
fix legal and static
thedavidmeister Oct 10, 2025
b004dd5
update the scripts
0xgleb Oct 10, 2025
539c82e
fix test fixtures
0xgleb Oct 10, 2025
08b8ebb
try adding lobsoup dep
0xgleb Oct 10, 2025
c9e48ab
try bumping up rainix
0xgleb Oct 10, 2025
6abbed0
try libsoup 3
0xgleb Oct 10, 2025
15bd0f1
try insecure
0xgleb Oct 10, 2025
e5ef0c1
Update libsoup version in flake.nix
rouzwelt Oct 11, 2025
8c424fc
Use --impure flag for tauri-shell development
rouzwelt Oct 11, 2025
cb50d97
Allow insecure Nixpkgs in Vercel docs preview workflow
rouzwelt Oct 11, 2025
6eba209
Allow insecure Nixpkgs in Vercel workflow
rouzwelt Oct 11, 2025
054da8d
Allow insecure Nixpkgs in Vercel preview workflow
rouzwelt Oct 11, 2025
0a59c11
Allow insecure Nixpkgs in Vercel preview workflow
rouzwelt Oct 11, 2025
236644e
Allow insecure Nixpkgs in Vercel production workflow
rouzwelt Oct 11, 2025
9e33287
Allow insecure Nix packages in workflow
rouzwelt Oct 11, 2025
6551dfe
Add NIXPKGS_ALLOW_INSECURE environment variable
rouzwelt Oct 11, 2025
2a62efa
Set NIXPKGS_ALLOW_INSECURE environment variable
rouzwelt Oct 11, 2025
7777180
Remove and re-add NIXPKGS_ALLOW_INSECURE env variable
rouzwelt Oct 11, 2025
756caa6
Move NIXPKGS_ALLOW_INSECURE to prep-all.sh step
rouzwelt Oct 11, 2025
648f15f
Restore NIXPKGS_ALLOW_INSECURE in workflow
rouzwelt Oct 11, 2025
51fb2b9
Move NIXPKGS_ALLOW_INSECURE to prep-all step
rouzwelt Oct 11, 2025
91abd78
Restore NIXPKGS_ALLOW_INSECURE in workflow
rouzwelt Oct 11, 2025
4f5dc89
upd
rouzwelt Oct 11, 2025
8c4da83
fmt
rouzwelt Oct 11, 2025
d1c75aa
Update flake.nix
rouzwelt Oct 12, 2025
0223a97
update flake
rouzwelt Oct 12, 2025
98ca493
update
rouzwelt Oct 12, 2025
148261c
Update vercel-preview.yaml
rouzwelt Oct 12, 2025
b531837
Merge branch 'main' into 2025-10-08-int
rouzwelt Oct 13, 2025
74a32b3
upd
rouzwelt Oct 14, 2025
d1b99fc
Merge branch 'main' into 2025-10-08-int
rouzwelt Oct 14, 2025
0d3c049
test v34
rouzwelt Oct 15, 2025
850adfb
Merge branch 'main' into 2025-10-08-int
thedavidmeister Oct 23, 2025
17905dd
fix error assertion
0xgleb Oct 24, 2025
4ff2c27
revert nix installer on cis
rouzwelt Oct 27, 2025
36dbee0
Update vercel-preview.yaml
rouzwelt Oct 27, 2025
ebee68c
Update Cargo.lock
rouzwelt Oct 27, 2025
1ea9782
Merge branch 'main' into 2025-10-08-int
rouzwelt Oct 27, 2025
3c5ecca
Update rain.interpreter
rouzwelt Oct 27, 2025
dd4bce6
fix rs
rouzwelt Oct 27, 2025
984c249
Merge branch 'main' into 2025-10-08-int
rouzwelt Oct 27, 2025
4c20625
update flake nix pkgs
rouzwelt Oct 27, 2025
96318e9
Update flake.nix
rouzwelt Oct 27, 2025
2c61385
update
rouzwelt Oct 27, 2025
9d5b0c9
update
rouzwelt Oct 27, 2025
16d0709
Update flake.lock
rouzwelt Oct 27, 2025
aded351
Update flake.lock
rouzwelt Oct 27, 2025
9563eb7
update
rouzwelt Oct 27, 2025
5b0faac
update
rouzwelt Oct 27, 2025
4d89bbb
update
rouzwelt Oct 27, 2025
30d2442
fix orderbook tests
rouzwelt Oct 28, 2025
dabf86e
update
rouzwelt Oct 28, 2025
6021d2d
update
rouzwelt Oct 28, 2025
a983a96
update
rouzwelt Oct 28, 2025
8ae697f
Update prep-all.sh
rouzwelt Oct 28, 2025
d5080ae
Update flake.nix
rouzwelt Oct 28, 2025
e69d725
Update flake.nix
rouzwelt Oct 28, 2025
139b458
Update prep-all.sh
rouzwelt Oct 28, 2025
11526ad
update
rouzwelt Oct 28, 2025
dde6ddd
update
rouzwelt Oct 28, 2025
f1cd85e
update
rouzwelt Oct 28, 2025
a7264d4
update
rouzwelt Oct 28, 2025
77099c8
Update flake.nix
rouzwelt Oct 28, 2025
edb4621
Update flake.nix
rouzwelt Oct 28, 2025
fc5269e
Update flake.nix
rouzwelt Oct 28, 2025
a367594
update
rouzwelt Oct 28, 2025
1d6c8a1
update
rouzwelt Oct 28, 2025
9f4edc8
update
rouzwelt Oct 28, 2025
1197f44
Update flake.lock
rouzwelt Oct 28, 2025
f104609
Update flake.lock
rouzwelt Oct 28, 2025
5ba9d7c
Update flake.lock
rouzwelt Oct 28, 2025
4115849
Update flake.nix
rouzwelt Oct 28, 2025
a29c683
update
rouzwelt Oct 28, 2025
a7d33cf
update flake
rouzwelt Oct 28, 2025
f2ac1c4
update
rouzwelt Oct 28, 2025
15fa1f6
Update foundry.lock
rouzwelt Oct 28, 2025
191d4b0
nix flake update
thedavidmeister Oct 29, 2025
05c2e5d
Merge branch 'main' into 2025-10-08-int
thedavidmeister Oct 29, 2025
7f32571
registry
Siddharth2207 Oct 29, 2025
7b97c7f
registry
Siddharth2207 Oct 29, 2025
beab91e
update
rouzwelt Oct 29, 2025
aae87c0
registry
Siddharth2207 Oct 29, 2025
4b19fa1
Update fullDeployment.test.ts
rouzwelt Oct 29, 2025
e12afd6
Update fullDeployment.test.ts
rouzwelt Oct 29, 2025
c995179
fmt
rouzwelt Oct 29, 2025
8549030
Update fullDeployment.test.ts
rouzwelt Oct 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
[submodule "lib/rain.interpreter"]
path = lib/rain.interpreter
url = https://github.com/rainlanguage/rain.interpreter
[submodule "lib/rain.tofu.erc20-decimals"]
path = lib/rain.tofu.erc20-decimals
url = https://github.com/rainlanguage/rain.tofu.erc20-decimals
1 change: 1 addition & 0 deletions REUSE.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ path = [
"flake.lock",
"flake.nix",
"foundry.toml",
"foundry.lock",
"slither.config.json",
"typeshare.toml",
"REUSE.toml",
Expand Down
12 changes: 6 additions & 6 deletions crates/cli/src/commands/order/calldata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,25 +133,25 @@ mod tests {
})
};

// mock iInterpreter() call
// mock I_INTERPRETER() call
rpc_server.mock(|when, then| {
when.path("/rpc").body_contains("0xf0cfdd37");
when.path("/rpc").body_contains("0x56fb83e9");
then.status(200)
.header("content-type", "application/json")
.json_body(build_address_return(1));
});

// mock iStore() call
// mock I_STORE() call
rpc_server.mock(|when, then| {
when.path("/rpc").body_contains("0xc19423bc");
when.path("/rpc").body_contains("0x251ac32e");
then.status(200)
.header("content-type", "application/json")
.json_body(build_address_return(2));
});

// mock iParser() call
// mock I_PARSER() call
rpc_server.mock(|when, then| {
when.path("/rpc").body_contains("0x24376855");
when.path("/rpc").body_contains("0xf79693f4");
then.status(200)
.header("content-type", "application/json")
.json_body(build_address_return(3));
Expand Down
6 changes: 3 additions & 3 deletions crates/common/src/fuzz/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use rain_error_decoding::{AbiDecodeFailedErrors, AbiDecodedErrorType};
use rain_interpreter_bindings::IInterpreterStoreV3::FullyQualifiedNamespace;
use rain_interpreter_bindings::IInterpreterV4::EvalV4;
use rain_interpreter_bindings::{
DeployerISP::{iInterpreterCall, iStoreCall},
DeployerISP::{I_INTERPRETERCall, I_STORECall},
IInterpreterV4::eval4Call,
};
use rain_interpreter_eval::eval::ForkParseArgs;
Expand Down Expand Up @@ -496,7 +496,7 @@ impl FuzzRunner {
.map_err(|e| FuzzRunnerError::ForkCallError(Box::new(e)))?;
let store = self
.forker
.alloy_call(Address::default(), deployer.address, iStoreCall {}, true)
.alloy_call(Address::default(), deployer.address, I_STORECall {}, true)
.await?
.typed_return;

Expand All @@ -505,7 +505,7 @@ impl FuzzRunner {
.alloy_call(
Address::default(),
deployer.address,
iInterpreterCall {},
I_INTERPRETERCall {},
true,
)
.await?
Expand Down
2 changes: 1 addition & 1 deletion crates/common/src/types/order_takes_list_flattened.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ mod tests {
let input_display = "-1.234567890123456789".to_string();
let input_amount = Float::parse(input_display.clone()).unwrap();

let output_display = "-0.98765432".to_string();
let output_display = "-9.8765432e-1".to_string();
let output_amount = Float::parse(output_display.clone()).unwrap();

trade_data.input_vault_balance_change.amount = SgBytes(input_amount.as_hex());
Expand Down
2 changes: 1 addition & 1 deletion crates/common/src/types/token_vault_flattened.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ mod tests {
let result = TokenVaultFlattened::try_from(sg_vault);
let flattened = result.unwrap();

assert_eq!(flattened.balance_display, "9.87650000000000000000001e4");
assert_eq!(flattened.balance_display, "98765.0000000000000000001");
assert_eq!(flattened.balance, SgBytes(balance_str.to_string()));
}
}
2 changes: 1 addition & 1 deletion crates/common/src/types/vault_balance_change_flattened.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ mod tests {
let result = VaultBalanceChangeFlattened::try_from(val);
assert!(result.is_ok());
let flattened = result.unwrap();
assert_eq!(flattened.amount_display_signed, "-0.5");
assert_eq!(flattened.amount_display_signed, "-5e-1");
}

#[test]
Expand Down
2 changes: 1 addition & 1 deletion crates/quote/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ mod tests {
},
MulticallResult {
success: false,
returnData: alloy::hex!("deadbeef").to_vec().into(), // Unknown error selector
returnData: alloy::hex!("ff00ff00").to_vec().into(), // Unknown error selector
Comment thread
rouzwelt marked this conversation as resolved.
},
]
.abi_encode();
Expand Down
26 changes: 20 additions & 6 deletions crates/test_fixtures/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use alloy::{
hex::decode,
network::{AnyNetwork, AnyTransactionReceipt, EthereumWallet, TransactionBuilder},
node_bindings::{Anvil, AnvilInstance},
primitives::{utils::parse_units, Address, Bytes, B256, U256},
primitives::{address, utils::parse_units, Address, Bytes, B256, U256},
providers::{ext::AnvilApi, PendingTransactionError, Provider, ProviderBuilder},
rpc::types::TransactionRequest,
serde::WithOtherFields,
Expand All @@ -14,7 +14,7 @@ use alloy::{
};
pub use rain_interpreter_test_fixtures::{Deployer, Interpreter, Parser, Store, ERC20};
use serde_json::value::RawValue;
use std::{marker::PhantomData, str::FromStr};
use std::marker::PhantomData;

use rain_interpreter_test_fixtures::LocalEvmProvider;
use rain_math_float::Float;
Expand All @@ -34,6 +34,11 @@ sol!(
"../../lib/rain.interpreter/lib/rain.interpreter.interface/lib/forge-std/src/interfaces//IMulticall3.sol"
);

sol!(
#![sol(all_derives = true, rpc = true)]
TOFUTokenDecimals, "../../lib/rain.tofu.erc20-decimals/out/TOFUTokenDecimals.sol/TOFUTokenDecimals.json"
);
Comment on lines +37 to +40

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify the external submodule path and artifact.

The sol! binding references an external submodule artifact at ../../lib/rain.tofu.erc20-decimals/out/TOFUTokenDecimals.sol/TOFUTokenDecimals.json. Ensure that:

  1. The submodule is properly initialized and built before this code runs
  2. The artifact path is correct and matches the Forge output structure
  3. The contract ABI and bytecode are compatible with the expected interface

🏁 Script executed:

#!/bin/bash
# Verify the TOFUTokenDecimals artifact exists and is valid

# Check if submodule directory exists
if [ -d "lib/rain.tofu.erc20-decimals" ]; then
    echo "✓ Submodule directory exists"
else
    echo "✗ Submodule directory not found"
    exit 1
fi

# Check if the artifact file exists
ARTIFACT="lib/rain.tofu.erc20-decimals/out/TOFUTokenDecimals.sol/TOFUTokenDecimals.json"
if [ -f "$ARTIFACT" ]; then
    echo "✓ Artifact file exists"
    # Verify it's valid JSON and contains expected fields
    if jq -e '.abi and .bytecode' "$ARTIFACT" > /dev/null 2>&1; then
        echo "✓ Artifact contains abi and bytecode"
    else
        echo "✗ Artifact missing required fields"
        exit 1
    fi
else
    echo "✗ Artifact file not found at: $ARTIFACT"
    echo "Run 'cd lib/rain.tofu.erc20-decimals && nix develop -c forge build' to build it"
    exit 1
fi

Length of output: 216


Ensure the TOFUTokenDecimals artifact exists and binding path is correct

  • The submodule directory exists, but lib/rain.tofu.erc20-decimals/out/TOFUTokenDecimals.sol/TOFUTokenDecimals.json was not found.
  • Run cd lib/rain.tofu.erc20-decimals && nix develop -c forge build (or forge build) to generate the JSON, then confirm it resides at out/.../TOFUTokenDecimals.json or adjust the ../../lib/... path in crates/test_fixtures/src/lib.rs.
🤖 Prompt for AI Agents
In crates/test_fixtures/src/lib.rs around lines 37 to 40, the sol! binding
references
../../lib/rain.tofu.erc20-decimals/out/TOFUTokenDecimals.sol/TOFUTokenDecimals.json
which does not exist; either generate the artifact by running `cd
lib/rain.tofu.erc20-decimals && nix develop -c forge build` (or `forge build`)
so the JSON appears under out/.../TOFUTokenDecimals.json, or correct the
relative path in the sol! macro to point to the actual location of
TOFUTokenDecimals.json after confirming where the submodule’s build output is
placed.


/// A local evm instance that wraps an Anvil instance and provider with
/// its signers, and with rain contracts already deployed on it.
/// The first signer wallet is the main wallet that would sign any transactions
Expand Down Expand Up @@ -104,6 +109,14 @@ impl LocalEvm {
.wallet(signer_wallets[0].clone())
.connect_http(anvil.endpoint_url());

provider
.anvil_set_code(
TOFU_TOKEN_DECIMALS_ADDRESS,
TOFUTokenDecimals::DEPLOYED_BYTECODE.clone(),
)
.await
.unwrap();

// deploy rain contracts
let orderbook = Orderbook::deploy(provider.clone()).await.unwrap();
let orderbook_subparser = OrderbookSubParser::deploy(provider.clone()).await.unwrap();
Expand All @@ -118,15 +131,14 @@ impl LocalEvm {
let deployer = Deployer::deploy(provider.clone(), config).await.unwrap();

// set the multicall 3 contract at its official address
let multicall3_address = Address::from_str(MULTICALL3_ADDRESS).unwrap();
provider
.anvil_set_code(
multicall3_address,
MULTICALL3_ADDRESS,
decode(MULTICALL3_BYTECODE).unwrap().into(),
)
.await
.unwrap();
let multicall3 = IMulticall3::new(multicall3_address, provider.clone());
let multicall3 = IMulticall3::new(MULTICALL3_ADDRESS, provider.clone());

Self {
anvil,
Expand Down Expand Up @@ -336,5 +348,7 @@ impl LocalEvm {
}
}

const MULTICALL3_ADDRESS: &str = "0xcA11bde05977b3631167028862bE2a173976CA11";
const MULTICALL3_ADDRESS: Address = address!("cA11bde05977b3631167028862bE2a173976CA11");
const MULTICALL3_BYTECODE: &str = "0x6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e1461025a578063bce38bd714610275578063c3077fa914610288578063ee82ac5e1461029b57600080fd5b80634d2301cc146101ec57806372425d9d1461022157806382ad56cb1461023457806386d516e81461024757600080fd5b80633408e470116100c65780633408e47014610191578063399542e9146101a45780633e64a696146101c657806342cbb15c146101d957600080fd5b80630f28c97d146100f8578063174dea711461011a578063252dba421461013a57806327e86d6e1461015b575b600080fd5b34801561010457600080fd5b50425b6040519081526020015b60405180910390f35b61012d610128366004610a85565b6102ba565b6040516101119190610bbe565b61014d610148366004610a85565b6104ef565b604051610111929190610bd8565b34801561016757600080fd5b50437fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0140610107565b34801561019d57600080fd5b5046610107565b6101b76101b2366004610c60565b610690565b60405161011193929190610cba565b3480156101d257600080fd5b5048610107565b3480156101e557600080fd5b5043610107565b3480156101f857600080fd5b50610107610207366004610ce2565b73ffffffffffffffffffffffffffffffffffffffff163190565b34801561022d57600080fd5b5044610107565b61012d610242366004610a85565b6106ab565b34801561025357600080fd5b5045610107565b34801561026657600080fd5b50604051418152602001610111565b61012d610283366004610c60565b61085a565b6101b7610296366004610a85565b610a1a565b3480156102a757600080fd5b506101076102b6366004610d18565b4090565b60606000828067ffffffffffffffff8111156102d8576102d8610d31565b60405190808252806020026020018201604052801561031e57816020015b6040805180820190915260008152606060208201528152602001906001900390816102f65790505b5092503660005b8281101561047757600085828151811061034157610341610d60565b6020026020010151905087878381811061035d5761035d610d60565b905060200281019061036f9190610d8f565b6040810135958601959093506103886020850185610ce2565b73ffffffffffffffffffffffffffffffffffffffff16816103ac6060870187610dcd565b6040516103ba929190610e32565b60006040518083038185875af1925050503d80600081146103f7576040519150601f19603f3d011682016040523d82523d6000602084013e6103fc565b606091505b50602080850191909152901515808452908501351761046d577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b5050600101610325565b508234146104e6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f4d756c746963616c6c333a2076616c7565206d69736d6174636800000000000060448201526064015b60405180910390fd5b50505092915050565b436060828067ffffffffffffffff81111561050c5761050c610d31565b60405190808252806020026020018201604052801561053f57816020015b606081526020019060019003908161052a5790505b5091503660005b8281101561068657600087878381811061056257610562610d60565b90506020028101906105749190610e42565b92506105836020840184610ce2565b73ffffffffffffffffffffffffffffffffffffffff166105a66020850185610dcd565b6040516105b4929190610e32565b6000604051808303816000865af19150503d80600081146105f1576040519150601f19603f3d011682016040523d82523d6000602084013e6105f6565b606091505b5086848151811061060957610609610d60565b602090810291909101015290508061067d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060448201526064016104dd565b50600101610546565b5050509250929050565b43804060606106a086868661085a565b905093509350939050565b6060818067ffffffffffffffff8111156106c7576106c7610d31565b60405190808252806020026020018201604052801561070d57816020015b6040805180820190915260008152606060208201528152602001906001900390816106e55790505b5091503660005b828110156104e657600084828151811061073057610730610d60565b6020026020010151905086868381811061074c5761074c610d60565b905060200281019061075e9190610e76565b925061076d6020840184610ce2565b73ffffffffffffffffffffffffffffffffffffffff166107906040850185610dcd565b60405161079e929190610e32565b6000604051808303816000865af19150503d80600081146107db576040519150601f19603f3d011682016040523d82523d6000602084013e6107e0565b606091505b506020808401919091529015158083529084013517610851577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b50600101610714565b6060818067ffffffffffffffff81111561087657610876610d31565b6040519080825280602002602001820160405280156108bc57816020015b6040805180820190915260008152606060208201528152602001906001900390816108945790505b5091503660005b82811015610a105760008482815181106108df576108df610d60565b602002602001015190508686838181106108fb576108fb610d60565b905060200281019061090d9190610e42565b925061091c6020840184610ce2565b73ffffffffffffffffffffffffffffffffffffffff1661093f6020850185610dcd565b60405161094d929190610e32565b6000604051808303816000865af19150503d806000811461098a576040519150601f19603f3d011682016040523d82523d6000602084013e61098f565b606091505b506020830152151581528715610a07578051610a07576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060448201526064016104dd565b506001016108c3565b5050509392505050565b6000806060610a2b60018686610690565b919790965090945092505050565b60008083601f840112610a4b57600080fd5b50813567ffffffffffffffff811115610a6357600080fd5b6020830191508360208260051b8501011115610a7e57600080fd5b9250929050565b60008060208385031215610a9857600080fd5b823567ffffffffffffffff811115610aaf57600080fd5b610abb85828601610a39565b90969095509350505050565b6000815180845260005b81811015610aed57602081850181015186830182015201610ad1565b81811115610aff576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015610bb1578583037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001895281518051151584528401516040858501819052610b9d81860183610ac7565b9a86019a9450505090830190600101610b4f565b5090979650505050505050565b602081526000610bd16020830184610b32565b9392505050565b600060408201848352602060408185015281855180845260608601915060608160051b870101935082870160005b82811015610c52577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa0888703018452610c40868351610ac7565b95509284019290840190600101610c06565b509398975050505050505050565b600080600060408486031215610c7557600080fd5b83358015158114610c8557600080fd5b9250602084013567ffffffffffffffff811115610ca157600080fd5b610cad86828701610a39565b9497909650939450505050565b838152826020820152606060408201526000610cd96060830184610b32565b95945050505050565b600060208284031215610cf457600080fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114610bd157600080fd5b600060208284031215610d2a57600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81833603018112610dc357600080fd5b9190910192915050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112610e0257600080fd5b83018035915067ffffffffffffffff821115610e1d57600080fd5b602001915036819003821315610a7e57600080fd5b8183823760009101908152919050565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc1833603018112610dc357600080fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa1833603018112610dc357600080fdfea2646970667358221220bb2b5c71a328032f97c676ae39a1ec2148d3e5d6f73d95e9b17910152d61f16264736f6c634300080c0033";

const TOFU_TOKEN_DECIMALS_ADDRESS: Address = address!("4f1C29FAAB7EDdF8D7794695d8259996734Cc665");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Document the address derivation.

The constant TOFU_TOKEN_DECIMALS_ADDRESS uses a specific address but lacks documentation explaining:

  1. How this address was derived (e.g., CREATE2 with specific salt, deterministic deployment)
  2. Why this specific address is used
  3. Whether this address is consistent across different environments

Consider adding a documentation comment:

+/// The canonical deployment address for TOFUTokenDecimals.
+/// This address is used in tests to etch the contract runtime code.
+/// Source: [explain derivation or reference]
 const TOFU_TOKEN_DECIMALS_ADDRESS: Address = address!("4f1C29FAAB7EDdF8D7794695d8259996734Cc665");
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const TOFU_TOKEN_DECIMALS_ADDRESS: Address = address!("4f1C29FAAB7EDdF8D7794695d8259996734Cc665");
/// The canonical deployment address for TOFUTokenDecimals.
/// This address is used in tests to etch the contract runtime code.
/// Source: [explain derivation or reference]
const TOFU_TOKEN_DECIMALS_ADDRESS: Address = address!("4f1C29FAAB7EDdF8D7794695d8259996734Cc665");
🤖 Prompt for AI Agents
In crates/test_fixtures/src/lib.rs at line 354, the constant
TOFU_TOKEN_DECIMALS_ADDRESS needs an explanatory doc comment: state exactly how
the address was derived (e.g., produced by CREATE2 with the specific salt and
init bytecode, or copied from a deterministic deployment script), why this
particular address is used in tests (e.g., to guarantee a stable token decimals
contract for fixtures), and whether it is expected to be identical across
environments; include a reference/link to the script/command that generates the
address (or the deployment tx/hash) and add/mention a small assertion or test
that recomputes the address from the same inputs to ensure consistency.

53 changes: 35 additions & 18 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@

outputs = { self, flake-utils, rainix, rain }:
flake-utils.lib.eachDefaultSystem (system:
let pkgs = rainix.pkgs.${system};
let
pkgs = rainix.pkgs.${system};
old-pkgs = rainix.old-pkgs.${system};
Comment thread
rouzwelt marked this conversation as resolved.
in rec {
packages = rec {

Expand Down Expand Up @@ -133,7 +135,7 @@
echo COMMIT_SHA=''${COMMIT_SHA} >> .env
echo VITE_WALLETCONNECT_PROJECT_ID=''${VITE_WALLETCONNECT_PROJECT_ID} >> .env
'';
additionalBuildInputs = [ pkgs.sentry-cli ];
additionalBuildInputs = [ old-pkgs.sentry-cli ];
Comment thread
rouzwelt marked this conversation as resolved.
};

ob-tauri-before-build-ci = rainix.mkTask.${system} {
Expand Down
14 changes: 14 additions & 0 deletions foundry.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"lib/rain.interpreter": {
"rev": "d1fee1b9c4a427ebd529b9c0b0e17718c1a4a99a"
},
"lib/rain.orderbook.interface": {
"rev": "dae86d795b32cb88005d9c47cbbbff9a5eef940a"
},
"lib/rain.tofu.erc20-decimals": {
"rev": "ca8e8bacf6c6cb3b9938a6961efb9f93cc1754f9"
},
"lib/sushixswap-v2": {
"rev": "ca38c64cf7c3042f6427414d7bff61c54293da51"
}
}
Loading