Skip to content

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

Six checks. Read the factory's code hash with view_account. Read the code hash new accounts get with get_config and get_approved_code_hashes. Read your account's global_contract_hash with view_account. Download both wasm files and hash them: the base58 of each sha256 equals its hash. Read contract_source_metadata to get the repository and commit the code was built from. Rebuild from that commit with the pinned image and compare the hashes. 1 Read the factory's code hash view_account on trade.unrlzd.near 4Ui31XRh… 2 Read the code new accounts get get_config, get_approved_code_hashes 53kXHafS… 3 Read your account's code view_account: global_contract_hash 53kXHafS… 4 Download both and hash them view_code, view_global_contract_code, sha256 base58 = hash 5 Read what each was built from contract_source_metadata (NEP-330) fa50eb18 6 Rebuild from that commit cargo near build reproducible-wasm, pinned image same sha256 The same hash on chain and from the source

Checking the contracts, from the chain to the source

Six checks. Read the factory's code hash with view_account. Read the code hash new accounts get with get_config and get_approved_code_hashes. Read your account's global_contract_hash with view_account. Download both wasm files and hash them: the base58 of each sha256 equals its hash. Read contract_source_metadata to get the repository and commit the code was built from. Rebuild from that commit with the pinned image and compare the hashes. 1 Read the factory's code hash view_account on trade.unrlzd.near 4Ui31XRh… 2 Read the code new accounts get get_config, get_approved_code_hashes 53kXHafS… 3 Read your account's code view_account: global_contract_hash 53kXHafS… 4 Download both and hash them view_code, view_global_contract_code, sha256 base58 = hash 5 Read what each was built from contract_source_metadata (NEP-330) fa50eb18 6 Rebuild from that commit cargo near build reproducible-wasm, pinned image same sha256 The same hash on chain and from the source
Figure 1.The six checks in order. Steps 1 to 5 are RPC reads; step 6 is a local build. The badges are the values mainnet returned on 15 October 2026.

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.

Terminal window
RPC=https://rpc.mainnet.near.org
q() { 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
# 4Ui31XRhDrQQafyETqbhcbxTPkCdx6e4UT7ntrSpaMnC
call 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 here
q "{\"request_type\":\"view_account\",\"finality\":\"final\",\"account_id\":\"$ACCOUNT\"}" | jq .result
Example output
{
"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

Every read goes through a public RPC node and changes nothing. view_account on the factory returns its code hash 4Ui31XRh. get_config returns the code hash new accounts get, 53kXHafS. view_account on a trading account returns an empty code_hash and the global_contract_hash 53kXHafS. view_code and view_global_contract_code return the two wasm files; the base58 of each file's sha256 equals its hash. contract_source_metadata returns the commit fa50eb18 and the version. You curl, jq, python3 RPC node rpc.mainnet.near.org Factory trade.unrlzd.near Trading account *.trade.unrlzd.near 1 view_account the factory's own code 2 code_hash 4Ui31XRh… 3 get_config the code new accounts get 4 code_hash 53kXHafS… 5 view_account a trading account 6 global_contract_hash 53kXHafS… 7 view_code · view_global_contract_code both wasm files 8 sha256 → base58 equal to both hashes 9 contract_source_metadata NEP-330 10 fa50eb18 · 1.6.0 Every read goes through the RPC node; none writes

The reads, with what mainnet returned

Every read goes through a public RPC node and changes nothing. view_account on the factory returns its code hash 4Ui31XRh. get_config returns the code hash new accounts get, 53kXHafS. view_account on a trading account returns an empty code_hash and the global_contract_hash 53kXHafS. view_code and view_global_contract_code return the two wasm files; the base58 of each file's sha256 equals its hash. contract_source_metadata returns the commit fa50eb18 and the version. 1 You → Factory view_account the factory's own code 2 Factory → You code_hash 4Ui31XRh… 3 You → Factory get_config the code new accounts get 4 Factory → You code_hash 53kXHafS… 5 You → Trading account view_account a trading account 6 Trading account → You global_contract_hash 53kXHafS… 7 You → RPC node view_code · view_global_contract_code both wasm files 8 You sha256 → base58 equal to both hashes 9 You → Trading account contract_source_metadata NEP-330 10 Trading account → You fa50eb18 · 1.6.0 Every read goes through the RPC node; none writes
Figure 2.The reads from the block above with what mainnet returned on 15 October 2026. Each one is a read through a public RPC node; blue is the one step that runs on your machine.

A mismatch says which part changed, and most of them have an ordinary cause:

  • get_approved_code_hashes lists 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’s contract_source_metadata to see its version and commit, then repeat the checks on this page for that commit.
  • Your global_contract_hash differs from the approved one. Your account runs earlier code that was approved when it was created or last upgraded. Hash it the same way with view_global_contract_code and 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.

A NEAR code hash is the base58 form of the wasm file’s sha256. In the same shell, download both files and hash them:

Terminal window
hash58() { python3 - "$1" <<'PY'
import hashlib, sys
d = 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] + s
print(d.hex(), s)
PY
}
q '{"request_type":"view_code","finality":"final","account_id":"trade.unrlzd.near"}' \
| jq -r .result.code_base64 | base64 --decode > factory.wasm
q '{"request_type":"view_global_contract_code","finality":"final","code_hash":"53kXHafSbLaYp8ZNbmgwDnWXrz8DtrpEvvQAHzNmY6Fu"}' \
| jq -r .result.code_base64 | base64 --decode > trading_account.wasm
hash58 factory.wasm # 33ac2400…364bb585 4Ui31XRhDrQQafyETqbhcbxTPkCdx6e4UT7ntrSpaMnC
hash58 trading_account.wasm # 3c231eb8…69ba0dac0c 53kXHafSbLaYp8ZNbmgwDnWXrz8DtrpEvvQAHzNmY6Fu

The factory file is 338,383 bytes and the trading-account file 953,496 bytes.

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”:

Terminal window
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/fa50eb18e86f697132ae19f247e5e81affd879e9

The 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:

Terminal window
git clone https://github.com/UNRLZD/contracts && cd contracts
git 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.wasm

Any change to the source, formatting included, changes the hashes, because panic messages carry line numbers.

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.

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.

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.

Terminal window
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).

Terminal window
call "$ACCOUNT" get_config | jq '{owner, fee_bps, caps, version}'
call "$ACCOUNT" get_withdraw_destinations
call "$ACCOUNT" get_automation_key

owner 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.

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.

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

  1. NEP-330, Source metadata
  2. NEP-591, Global contracts
  3. cargo-near, reproducible builds
  4. NEAR RPC, accounts and contracts
  5. Nomicon, Access keys

Last verified 15 October 2026 against R4.