Conversation
Collaborator
Author
|
@copilot resolve the merge conflicts in this pull request |
Contributor
Merged |
kiseln
requested changes
Jun 8, 2026
| /// Recovered Ethereum address does not match the expected signer. | ||
| const E_INVALID_SIGNATURE: u64 = 3; | ||
|
|
||
| const MAX_ALLOWED_DECIMALS: u8 = 18; |
Contributor
There was a problem hiding this comment.
With u64 to store balances this is incompatible. I suggest we use the standard 8 decimals
kiseln
approved these changes
Jun 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat: Aptos support
Adds the Aptos side of the Omni Bridge — a complete Move package that
mirrors the EVM and Starknet implementations — plus the NEAR-side
ChainKind::Aptoswiring so transfers can flow end-to-end.What's in this PR
Aptos Move package (aptos/)
omni_bridge::omni_bridgeinitialize,init_transfer,fin_transfer,deploy_token,log_metadata,set_token_metadata, pause, role management, viewsomni_bridge::bridge_tokenMintRef/BurnRef/TransferRef/MutateMetadataRefas a private resource;package funinterfaceomni_bridge::bridge_typesomni_bridge::borshencode_string,encode_byte_vec); primitives delegate tobcs::to_bytesomni_bridge::utilsaptos_std::secp256k1+ keccak256NEAR-side integration
ChainKind::Aptos = 13andOmniAddress::Aptos(AptosAddress)(H256alias)OmniAddress::FromStraccepts"aptos:0x..."get_native_token_address(Aptos)returns the canonical APT FA metadata address (0xa)CI
compile+teston PR.mvmodules +package-metadata.bcsin the release zipArchitecture highlights
BridgeStatelives on a deterministic Object owned by@omni_bridge(seedb"omni_bridge::state").disable_ungated_transferpins it permanently — deployer-key compromise can't move locked funds.Table<u8, vector<address>>— three roles (Admin,Pauser,MetadataAdmin) with multi-holder support, genericgrant_role/revoke_role, last-admin guard prevents bricking. Discoverable off-chain viaall_roles().create_named_objectseed — no keccak (Aptos's seed is arbitrary-length, unlike Starknet'sfelt252).package funfrom theomni_bridgepackage.Borsh compatibility
The Borsh payload encoding is byte-identical to the Starknet variant so the NEAR MPC signature works without per-chain branching on the NEAR side:
token_addressandrecipientmessagefield deliberately untagged (matches Starknet)Security invariants
destination_noncechecked + marked before any token transfer;origin_nonceincremented atomicallyInitTransfercarries every field the NEAR side needs to reconstruct the transferRoles & operational model
Adminnear_bridge_derived_address, set pause flagsPauserpause_allonlyMetadataAdminset_token_metadata(icon URI / project URI)Each role accepts an unbounded list of holders. Suggested ops setup: cold-multisig Admin, warm-multisig Pauser, smaller-key MetadataAdmin.
Testing
35 unit tests covering:
init_transfer(7 tests): bridged-token burn, non-bridge-token lock, nonce increment, paused, zero amount, fee≥amount, amount>u64::MAXRun with:
aptos move test --named-addresses omni_bridge=0xCAFE