Verify the contracts
Check the code your trading account runs against the published source, yourself.
You don’t have to take our word for what your trading account runs. The contract source is published at UNRLZD/contracts under the Business Source License 1.1, which lets anyone read, build and verify it. Everything on this page uses public RPC reads and a local build, and none of it needs an account.
The check has two halves: the code on chain hashes to the values below, and those values come out of a rebuild of the published commit.
Checking the contracts, from the chain to the source
Checking the contracts, from the chain to the source
What runs on chain
Section titled “What runs on chain”Two pieces of code matter. The factory, trade.unrlzd.near, runs factory 1.3.0 as its own contract. Every trading account runs trading-account 1.6.0, which is deployed once as a NEP-591 global contract and named by its hash. NEP-591 puts it plainly: “Contracts deployed by hash are effectively immutable and cannot be updated”. An account moves to other code only by switching to another hash, which the Code changes section covers.
Read the hashes
Section titled “Read the hashes”RPC=https://rpc.mainnet.near.orgq() { curl -s "$RPC" -H 'Content-Type: application/json' \ -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"query\",\"params\":$1}"; }call() { q "{\"request_type\":\"call_function\",\"finality\":\"final\",\"account_id\":\"$1\",\"method_name\":\"$2\",\"args_base64\":\"e30=\"}" \ | jq '.result.result | implode | fromjson'; }
q '{"request_type":"view_account","finality":"final","account_id":"trade.unrlzd.near"}' | jq -r .result.code_hash# 4Ui31XRhDrQQafyETqbhcbxTPkCdx6e4UT7ntrSpaMnCcall trade.unrlzd.near get_config | jq '{admin, code_hash, fee_bps: .fee_config.fee_bps}'# { "admin": "unrlzd.sputnik-dao.near", "code_hash": "53kXHafSbLaYp8ZNbmgwDnWXrz8DtrpEvvQAHzNmY6Fu", "fee_bps": 75 }call trade.unrlzd.near get_approved_code_hashes# [ "53kXHafSbLaYp8ZNbmgwDnWXrz8DtrpEvvQAHzNmY6Fu" ]ACCOUNT='<your-account>.trade.unrlzd.near' # put your own trading account hereq "{\"request_type\":\"view_account\",\"finality\":\"final\",\"account_id\":\"$ACCOUNT\"}" | jq .result{ "amount": "2500000000000000000000000", // example: 2.5 NEAR, in yoctoNEAR "locked": "0", "code_hash": "11111111111111111111111111111111", "global_contract_hash": "53kXHafSbLaYp8ZNbmgwDnWXrz8DtrpEvvQAHzNmY6Fu", "storage_usage": 3533, // example: bytes your account stores "storage_paid_at": 0, "block_height": 220000000, // example: the block the read used "block_hash": "<hash of that block>" // example}The two hashes are the part to compare. The balance, storage and block fields differ for every account and every read. A trading account’s own code_hash is all ones because it stores no code of its own. Its global_contract_hash is the code it runs, and on an account that runs the approved code it equals the hash get_approved_code_hashes returned above. An error with UNKNOWN_ACCOUNT means the name in ACCOUNT isn’t an account on NEAR: check it for a typo.
The reads, with what mainnet returned
The reads, with what mainnet returned
If a value doesn’t match
Section titled “If a value doesn’t match”A mismatch says which part changed, and most of them have an ordinary cause:
get_approved_code_hasheslists another hash, or two. The factory’s admin has approved newer code. It reaches accounts created after the 24-hour wait; your account keeps its code until you upgrade. Read the new hash’scontract_source_metadatato see its version and commit, then repeat the checks on this page for that commit.- Your
global_contract_hashdiffers from the approved one. Your account runs earlier code that was approved when it was created or last upgraded. Hash it the same way withview_global_contract_codeand compare it with that version’s published commit. - The rebuild gives other hashes. The build wasn’t the pinned one: another image, another
cargo-near, or a changed file. Start again from a clean clone of the commit.
Hash the code yourself
Section titled “Hash the code yourself”A NEAR code hash is the base58 form of the wasm file’s sha256. In the same shell, download both files and hash them:
hash58() { python3 - "$1" <<'PY'import hashlib, sysd = hashlib.sha256(open(sys.argv[1], "rb").read()).digest()a, n, s = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz", int.from_bytes(d, "big"), ""while n: n, r = divmod(n, 58); s = a[r] + sprint(d.hex(), s)PY}q '{"request_type":"view_code","finality":"final","account_id":"trade.unrlzd.near"}' \ | jq -r .result.code_base64 | base64 --decode > factory.wasmq '{"request_type":"view_global_contract_code","finality":"final","code_hash":"53kXHafSbLaYp8ZNbmgwDnWXrz8DtrpEvvQAHzNmY6Fu"}' \ | jq -r .result.code_base64 | base64 --decode > trading_account.wasmhash58 factory.wasm # 33ac2400…364bb585 4Ui31XRhDrQQafyETqbhcbxTPkCdx6e4UT7ntrSpaMnChash58 trading_account.wasm # 3c231eb8…69ba0dac0c 53kXHafSbLaYp8ZNbmgwDnWXrz8DtrpEvvQAHzNmY6FuThe factory file is 338,383 bytes and the trading-account file 953,496 bytes.
Rebuild from source
Section titled “Rebuild from source”The chain says which commit the code came from. Both contracts implement NEP-330’s contract_source_metadata, whose build details exist so that others can “reproduce the same WASM”:
call trade.unrlzd.near contract_source_metadata | jq '{version, link, build_info}'call "$ACCOUNT" contract_source_metadata | jq '{version, link, path: .build_info.contract_path}'# factory 1.3.0 and trading-account 1.6.0, both at# https://github.com/UNRLZD/contracts/tree/fa50eb18e86f697132ae19f247e5e81affd879e9The build details name the Docker image by tag and digest, sourcescan/cargo-near:0.22.0-rust-1.97.1@sha256:74670…b2234, which is the same pin both crates carry in their Cargo.toml (trading-account/Cargo.toml:35-41). NEP-330 asks for the digest because “a tag could be reassigned to a different image”. The recorded command, cargo near build non-reproducible-wasm --locked --no-abi, is what runs inside that image; you start it with reproducible-wasm from a clean clone:
git clone https://github.com/UNRLZD/contracts && cd contractsgit checkout fa50eb18e86f697132ae19f247e5e81affd879e9(cd factory && cargo near build reproducible-wasm) # needs Docker and cargo-near 0.22.0(cd trading-account && cargo near build reproducible-wasm)shasum -a 256 target/near/factory/factory.wasm target/near/trading_account/trading_account.wasm# 33ac2400d9c03806655fc4e81734a305a31f8d2a523b3fbe4c01595a364bb585 …/factory.wasm# 3c231eb834580eba5c9747e15deda9fa68b72fab395b71c6f621f469ba0dac0c …/trading_account.wasmAny change to the source, formatting included, changes the hashes, because panic messages carry line numbers.
Expected values
Section titled “Expected values”Each value is what the factory should return, and how to read it.
| Value | Expected | Read with |
|---|---|---|
| Factory code | 4Ui31XRhDrQQafyETqbhcbxTPkCdx6e4UT7ntrSpaMnC, factory 1.3.0 |
view_account |
| Factory wasm sha256 | 33ac2400d9c03806655fc4e81734a305a31f8d2a523b3fbe4c01595a364bb585 |
view_code |
| Trading-account code | 53kXHafSbLaYp8ZNbmgwDnWXrz8DtrpEvvQAHzNmY6Fu, trading-account 1.6.0 |
get_config, get_approved_code_hashes |
| Trading-account wasm sha256 | 3c231eb834580eba5c9747e15deda9fa68b72fab395b71c6f621f469ba0dac0c |
view_global_contract_code |
| Admin | unrlzd.sputnik-dao.near |
get_config |
| Fee for new accounts | 75 bps (0.75%) to fees.unrlzd.near |
get_config |
| Wrapped NEAR | wrap.near |
get_config |
| Venue allowlist | 24 entries | get_config |
| Code timelock | 86400000000000 ns, 24 hours |
get_admin_state |
| Source | UNRLZD/contracts at fa50eb18 |
contract_source_metadata |
The repository’s scripts/check-factory.sh runs these reads and exits non-zero on any mismatch.
What a match tells you
Section titled “What a match tells you”A match tells you the bytes on chain are the published commit, built with the pinned tools, and that the factory is set up as listed.
Check your own account
Section titled “Check your own account”The reads above check the code every account runs. Three more show what your own account allows today. Run them in the same shell, with ACCOUNT set to your trading account.
Its keys
Section titled “Its keys”q "{\"request_type\":\"view_access_key_list\",\"finality\":\"final\",\"account_id\":\"$ACCOUNT\"}" \ | jq '.result.keys[] | {public_key, permission: .access_key.permission}'Every entry should be a FunctionCall key whose receiver_id is your own trading account. Count the trading keys against the devices you use. A key you don’t recognise is one to remove from your owner wallet (Risks has the steps).
Its owner, caps and addresses
Section titled “Its owner, caps and addresses”call "$ACCOUNT" get_config | jq '{owner, fee_bps, caps, version}'call "$ACCOUNT" get_withdraw_destinationscall "$ACCOUNT" get_automation_keyowner should be the wallet you signed up with, because it is the account withdraw_to_owner pays. A cap of 340282366920938463463374607431768211455, the largest 128-bit number, means no cap is set. An address reads active: false for its first hour: an address you didn’t list is one to remove from your owner wallet before that hour ends. get_automation_key returns the same 24/7 key the key list shows, or null.
Code changes
Section titled “Code changes”The factory’s admin can only propose a code hash, and the proposal takes effect 24 hours later. Approved code reaches accounts created from then on. Your account changes code only when you upgrade with owner_upgrade in your wallet, or when auto-upgrade, which is off until you turn it on, applies an approved hash 72 hours after it first saw it. Your owner wallet or a trading key can veto it in that time.
Watch for a non-null pending_code in get_admin_state to see a proposal before it takes effect.
Parameters
Section titled “Parameters”| Parameter | Value | Constant | Source |
|---|---|---|---|
| Build image | sourcescan/cargo-near:0.22.0-rust-1.97.1 |
image |
trading-account/Cargo.toml:38 |
| Image digest | sha256:7467038bdddc86484b73b416eeadce926ff59013e128e53dec5a19e1cb4b2234 |
image_digest |
trading-account/Cargo.toml:39 |
| Command in the image | cargo near build non-reproducible-wasm --locked --no-abi |
container_build_command |
trading-account/Cargo.toml:41 |
Sources
Last verified 15 October 2026 against R4.