Skip to content

Commit 0077f34

Browse files
authored
Merge pull request #2494 from AmbireTech/release/v2.102
Release / v2.102.0, v2.102.1, v2.102.2 and v2.102.3
2 parents dd14fb9 + e3b49c4 commit 0077f34

61 files changed

Lines changed: 3400 additions & 449 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/general-review.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ jobs:
1414
github.event_name == 'workflow_dispatch' ||
1515
(github.event.sender.type != 'Bot' &&
1616
github.event_name == 'issue_comment' &&
17+
contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association) &&
1718
contains(github.event.comment.body, '/review') &&
1819
!contains(github.event.comment.body, '/security-review'))
1920
permissions:
@@ -22,8 +23,16 @@ jobs:
2223
contents: read
2324
uses: ./.github/workflows/pr-agent.yml
2425
with:
25-
model: openrouter/moonshotai/kimi-k2.6
26-
fallback_models: '["openrouter/anthropic/claude-sonnet-4.6"]'
26+
# Allow everyone to request a review from Sonnet, without a separate workflow file
27+
# and without them typing out the whole model name. Done so we can test with both models
28+
model: >-
29+
${{ contains(github.event.comment.body, '--sonnet')
30+
&& 'openrouter/anthropic/claude-sonnet-4.6'
31+
|| 'openrouter/moonshotai/kimi-k2.6:nitro' }}
32+
fallback_models: >-
33+
${{ contains(github.event.comment.body, '--sonnet')
34+
&& '["openrouter/moonshotai/kimi-k2.6:nitro"]'
35+
|| '["openrouter/anthropic/claude-sonnet-4.6"]' }}
2736
extra_instructions: |
2837
You are reviewing changes in `ambire-common`, the environment-agnostic core
2938
business-logic package of a security-sensitive Web3 wallet. It is imported by
@@ -80,4 +89,4 @@ jobs:
8089
severity (High/Medium/Low), quote the exact code, and explain the concrete
8190
failure it causes.
8291
secrets:
83-
OPENROUTER_KEY: ${{ secrets.OPENROUTER__KEY }}
92+
OPENROUTER_KEY: ${{ secrets.OPENROUTER__KEY }}

.github/workflows/security-review.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ jobs:
1414
github.event_name == 'workflow_dispatch' ||
1515
(github.event.sender.type != 'Bot' &&
1616
github.event_name == 'issue_comment' &&
17+
contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association) &&
1718
contains(github.event.comment.body, '/security-review'))
1819
permissions:
1920
pull-requests: write
@@ -23,8 +24,8 @@ jobs:
2324
with:
2425
model: openrouter/anthropic/claude-opus-4.7
2526
fallback_models: '["openrouter/openai/gpt-5.5"]'
26-
require_todo_scan: "false"
27-
require_estimate_effort_to_review: "false"
27+
require_todo_scan: 'false'
28+
require_estimate_effort_to_review: 'false'
2829
extra_instructions: |
2930
You are performing a SECURITY review of `ambire-common`, the environment-agnostic
3031
core of a self-custodial Web3 wallet. Focus exclusively on security, privacy, and
@@ -62,7 +63,7 @@ jobs:
6263
6. Use cryptography correctly. Vetted primitives with correct parameters, unique
6364
IVs/salts/nonces, sound entropy, safe key derivation.
6465
65-
7. Preserve state integrity. Multi-step state or storage mutations must be atomic or roll back;
66+
7. Preserve state integrity. Multi-step state or storage mutations must be atomic or roll back;
6667
migrations and recovery flows must fail loudly rather than silently leaving sensitive or inconsistent state.
6768
6869
8. Financial/numeric logic must avoid bigint precision loss,
@@ -81,4 +82,4 @@ jobs:
8182
Be thorough and adversarial; do not stop early. If the diff appears truncated, say so
8283
and treat unseen code as unreviewed.
8384
secrets:
84-
OPENROUTER_KEY: ${{ secrets.OPENROUTER__KEY }}
85+
OPENROUTER_KEY: ${{ secrets.OPENROUTER__KEY }}

contracts/compiled/EnsGetter.json

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
{
2+
"abi": [
3+
{
4+
"inputs": [
5+
{
6+
"internalType": "address",
7+
"name": "universalResolver",
8+
"type": "address"
9+
},
10+
{
11+
"internalType": "address[]",
12+
"name": "addresses",
13+
"type": "address[]"
14+
},
15+
{
16+
"internalType": "uint256",
17+
"name": "coinType",
18+
"type": "uint256"
19+
},
20+
{
21+
"internalType": "string[]",
22+
"name": "gateways",
23+
"type": "string[]"
24+
}
25+
],
26+
"name": "getNames",
27+
"outputs": [
28+
{
29+
"components": [
30+
{
31+
"internalType": "string",
32+
"name": "resolvedName",
33+
"type": "string"
34+
},
35+
{
36+
"internalType": "bool",
37+
"name": "hasName",
38+
"type": "bool"
39+
},
40+
{
41+
"internalType": "bool",
42+
"name": "needsOffchainLookup",
43+
"type": "bool"
44+
}
45+
],
46+
"internalType": "struct EnsGetter.ReverseLookupResult[]",
47+
"name": "results",
48+
"type": "tuple[]"
49+
}
50+
],
51+
"stateMutability": "view",
52+
"type": "function"
53+
},
54+
{
55+
"inputs": [
56+
{
57+
"internalType": "address",
58+
"name": "universalResolver",
59+
"type": "address"
60+
},
61+
{
62+
"internalType": "address",
63+
"name": "lookupAddress",
64+
"type": "address"
65+
},
66+
{
67+
"internalType": "uint256",
68+
"name": "coinType",
69+
"type": "uint256"
70+
},
71+
{
72+
"internalType": "string[]",
73+
"name": "gateways",
74+
"type": "string[]"
75+
}
76+
],
77+
"name": "getReverseName",
78+
"outputs": [
79+
{
80+
"internalType": "string",
81+
"name": "resolvedName",
82+
"type": "string"
83+
}
84+
],
85+
"stateMutability": "view",
86+
"type": "function"
87+
}
88+
],
89+
"bin": "0x608080604052346100165761083e908161001c8239f35b600080fdfe6040608081526004908136101561001557600080fd5b6000803560e01c928363471f77061461003f5750505063d4ff0d841461003a57600080fd5b61038e565b346102565760803660031901126102565780359061005c8261025a565b67ffffffffffffffff6024358181116102525761007c903690840161027d565b94906044359260643590811161024e57610099903690860161027d565b956100a388610536565b97845b8181106100be578a51806100ba8c826102f6565b0390f35b80808b8d89878d8f89908f8d908f6100fe6100e56100e06101759f88856105e9565b6105fe565b73ffffffffffffffffffffffffffffffffffffffff1690565b1561023e576100e08b61014596610114936105e9565b975197889687967fd4ff0d840000000000000000000000000000000000000000000000000000000088528701610737565b0381305afa8a918161021a575b506101ea57508d90610162610793565b8c8151101561017a575b505050506105ae565b6100a6565b602001517fffffffff00000000000000000000000000000000000000000000000000000000167f556f183000000000000000000000000000000000000000000000000000000000146101cd575b8f61016c565b6101e2926101da9161077f565b510160019052565b808c8c6101c7565b8051156102125782826101da9261020661020d9660209661077f565b515261077f565b6105ae565b5050506105ae565b6102379192503d808d833e61022f81836104fc565b810190610666565b9038610152565b50505050505050505050506105ae565b8280fd5b8480fd5b5080fd5b73ffffffffffffffffffffffffffffffffffffffff81160361027857565b600080fd5b9181601f840112156102785782359167ffffffffffffffff8311610278576020808501948460051b01011161027857565b60005b8381106102c15750506000910152565b81810151838201526020016102b1565b906020916102ea815180928185528580860191016102ae565b601f01601f1916010190565b602080820190808352835180925260409283810182858560051b8401019601946000925b85841061032b575050505050505090565b909192939495968580600192603f198582030187528a51908680610357845160608086528501906102d1565b93858101511515868501520151151591015299019401940192959493919061031a565b90602061038b9281815201906102d1565b90565b3461027857600319608036820112610278576004356103ac8161025a565b602435916103b98361025a565b6064359167ffffffffffffffff83116102785761046273ffffffffffffffffffffffffffffffffffffffff610479956103f8600096369060040161027d565b979095604051926bffffffffffffffffffffffff199060601b16602084015260148352610424836104db565b604051988997889687957fb7d6ca640000000000000000000000000000000000000000000000000000000087526060600488015260648701906102d1565b9260443560248701528584030160448601526106ad565b0392165afa80156104c0576100ba9160009161049d575b506040519182918261037a565b6104b8913d8091833e6104b081836104fc565b8101906107c3565b505038610490565b610773565b634e487b7160e01b600052604160045260246000fd5b6040810190811067ffffffffffffffff8211176104f757604052565b6104c5565b90601f8019910116810190811067ffffffffffffffff8211176104f757604052565b67ffffffffffffffff81116104f75760051b60200190565b906105408261051e565b604061054e815192836104fc565b838252819361055f601f199161051e565b0190600090815b838110610574575050505050565b8151906060918281019281841067ffffffffffffffff8511176104f757602093855281528285818301528585830152828801015201610566565b60001981146105bd5760010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b91908110156105f95760051b0190565b6105d3565b3561038b8161025a565b67ffffffffffffffff81116104f757601f01601f191660200190565b81601f8201121561027857805161063a81610608565b9261064860405194856104fc565b818452602082840101116102785761038b91602080850191016102ae565b9060208282031261027857815167ffffffffffffffff81116102785761038b9201610624565b908060209392818452848401376000828201840152601f01601f1916010190565b9082818152602080910193818360051b82010194846000925b8584106106d7575050505050505090565b90919293949596601f198282030184528735601e198436030181121561027857830186810191903567ffffffffffffffff8111610278578036038313610278576107268892839260019561068c565b9901940194019295949391906106c6565b909261038b959360809373ffffffffffffffffffffffffffffffffffffffff8092168452166020830152604082015281606082015201916106ad565b6040513d6000823e3d90fd5b80518210156105f95760209160051b010190565b3d156107be573d906107a482610608565b916107b260405193846104fc565b82523d6000602084013e565b606090565b906060828203126102785781519067ffffffffffffffff8211610278576107eb918301610624565b91604060208301516107fc8161025a565b92015161038b8161025a56fea2646970667358221220b53dafb60ac7968b776b551e9bd45cba3f95b78bbf38f0b2445721ab1f1cb7c564736f6c63430008130033",
90+
"binRuntime": "0x6040608081526004908136101561001557600080fd5b6000803560e01c928363471f77061461003f5750505063d4ff0d841461003a57600080fd5b61038e565b346102565760803660031901126102565780359061005c8261025a565b67ffffffffffffffff6024358181116102525761007c903690840161027d565b94906044359260643590811161024e57610099903690860161027d565b956100a388610536565b97845b8181106100be578a51806100ba8c826102f6565b0390f35b80808b8d89878d8f89908f8d908f6100fe6100e56100e06101759f88856105e9565b6105fe565b73ffffffffffffffffffffffffffffffffffffffff1690565b1561023e576100e08b61014596610114936105e9565b975197889687967fd4ff0d840000000000000000000000000000000000000000000000000000000088528701610737565b0381305afa8a918161021a575b506101ea57508d90610162610793565b8c8151101561017a575b505050506105ae565b6100a6565b602001517fffffffff00000000000000000000000000000000000000000000000000000000167f556f183000000000000000000000000000000000000000000000000000000000146101cd575b8f61016c565b6101e2926101da9161077f565b510160019052565b808c8c6101c7565b8051156102125782826101da9261020661020d9660209661077f565b515261077f565b6105ae565b5050506105ae565b6102379192503d808d833e61022f81836104fc565b810190610666565b9038610152565b50505050505050505050506105ae565b8280fd5b8480fd5b5080fd5b73ffffffffffffffffffffffffffffffffffffffff81160361027857565b600080fd5b9181601f840112156102785782359167ffffffffffffffff8311610278576020808501948460051b01011161027857565b60005b8381106102c15750506000910152565b81810151838201526020016102b1565b906020916102ea815180928185528580860191016102ae565b601f01601f1916010190565b602080820190808352835180925260409283810182858560051b8401019601946000925b85841061032b575050505050505090565b909192939495968580600192603f198582030187528a51908680610357845160608086528501906102d1565b93858101511515868501520151151591015299019401940192959493919061031a565b90602061038b9281815201906102d1565b90565b3461027857600319608036820112610278576004356103ac8161025a565b602435916103b98361025a565b6064359167ffffffffffffffff83116102785761046273ffffffffffffffffffffffffffffffffffffffff610479956103f8600096369060040161027d565b979095604051926bffffffffffffffffffffffff199060601b16602084015260148352610424836104db565b604051988997889687957fb7d6ca640000000000000000000000000000000000000000000000000000000087526060600488015260648701906102d1565b9260443560248701528584030160448601526106ad565b0392165afa80156104c0576100ba9160009161049d575b506040519182918261037a565b6104b8913d8091833e6104b081836104fc565b8101906107c3565b505038610490565b610773565b634e487b7160e01b600052604160045260246000fd5b6040810190811067ffffffffffffffff8211176104f757604052565b6104c5565b90601f8019910116810190811067ffffffffffffffff8211176104f757604052565b67ffffffffffffffff81116104f75760051b60200190565b906105408261051e565b604061054e815192836104fc565b838252819361055f601f199161051e565b0190600090815b838110610574575050505050565b8151906060918281019281841067ffffffffffffffff8511176104f757602093855281528285818301528585830152828801015201610566565b60001981146105bd5760010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b91908110156105f95760051b0190565b6105d3565b3561038b8161025a565b67ffffffffffffffff81116104f757601f01601f191660200190565b81601f8201121561027857805161063a81610608565b9261064860405194856104fc565b818452602082840101116102785761038b91602080850191016102ae565b9060208282031261027857815167ffffffffffffffff81116102785761038b9201610624565b908060209392818452848401376000828201840152601f01601f1916010190565b9082818152602080910193818360051b82010194846000925b8584106106d7575050505050505090565b90919293949596601f198282030184528735601e198436030181121561027857830186810191903567ffffffffffffffff8111610278578036038313610278576107268892839260019561068c565b9901940194019295949391906106c6565b909261038b959360809373ffffffffffffffffffffffffffffffffffffffff8092168452166020830152604082015281606082015201916106ad565b6040513d6000823e3d90fd5b80518210156105f95760209160051b010190565b3d156107be573d906107a482610608565b916107b260405193846104fc565b82523d6000602084013e565b606090565b906060828203126102785781519067ffffffffffffffff8211610278576107eb918301610624565b91604060208301516107fc8161025a565b92015161038b8161025a56fea2646970667358221220b53dafb60ac7968b776b551e9bd45cba3f95b78bbf38f0b2445721ab1f1cb7c564736f6c63430008130033"
91+
}

contracts/deployless/EnsGetter.sol

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
// SPDX-License-Identifier: agpl-3.0
2+
pragma solidity ^0.8.19;
3+
4+
interface IUniversalResolver {
5+
function reverseWithGateways(
6+
bytes calldata reverseName,
7+
uint256 coinType,
8+
string[] calldata gateways
9+
) external view returns (string memory resolvedName, address resolver, address reverseResolver);
10+
}
11+
12+
contract EnsGetter {
13+
struct ReverseLookupResult {
14+
string resolvedName;
15+
bool hasName;
16+
// True when the reverse lookup reverted with an EIP-3668 OffchainLookup, meaning the name
17+
// lives behind a CCIP-read gateway
18+
// The caller is expected to retry these addresses off-chain
19+
bool needsOffchainLookup;
20+
}
21+
22+
// EIP-3668
23+
bytes4 constant OFFCHAIN_LOOKUP_SELECTOR = 0x556f1830;
24+
25+
function getNames(
26+
address universalResolver,
27+
address[] calldata addresses,
28+
uint256 coinType,
29+
string[] calldata gateways
30+
) external view returns (ReverseLookupResult[] memory results) {
31+
uint256 len = addresses.length;
32+
results = new ReverseLookupResult[](len);
33+
34+
for (uint256 i = 0; i < len; i++) {
35+
if (addresses[i] == address(0)) continue;
36+
37+
try this.getReverseName(universalResolver, addresses[i], coinType, gateways) returns (
38+
string memory resolvedName
39+
) {
40+
if (bytes(resolvedName).length == 0) continue;
41+
42+
results[i].resolvedName = resolvedName;
43+
results[i].hasName = true;
44+
} catch (bytes memory err) {
45+
// A missing/invalid reverse record reverts and should not fail the whole batch.
46+
// An OffchainLookup revert is surfaced so the caller can resolve it off-chain.
47+
if (err.length >= 4) {
48+
bytes4 selector;
49+
assembly {
50+
selector := mload(add(err, 0x20))
51+
}
52+
if (selector == OFFCHAIN_LOOKUP_SELECTOR) results[i].needsOffchainLookup = true;
53+
}
54+
}
55+
}
56+
}
57+
58+
function getReverseName(
59+
address universalResolver,
60+
address lookupAddress,
61+
uint256 coinType,
62+
string[] calldata gateways
63+
) external view returns (string memory resolvedName) {
64+
(resolvedName, , ) = IUniversalResolver(universalResolver).reverseWithGateways(
65+
abi.encodePacked(lookupAddress),
66+
coinType,
67+
gateways
68+
);
69+
}
70+
}

0 commit comments

Comments
 (0)