├── .envrc ├── js ├── frontend │ ├── src │ │ ├── features │ │ │ ├── swap │ │ │ │ ├── consts │ │ │ │ │ ├── env.ts │ │ │ │ │ ├── settings.ts │ │ │ │ │ ├── abi │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ └── erc20permit-nonces-abi.ts │ │ │ │ │ ├── eth.ts │ │ │ │ │ ├── vara.ts │ │ │ │ │ └── sails │ │ │ │ │ │ └── index.ts │ │ │ │ ├── components │ │ │ │ │ ├── swap │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ └── swap.tsx │ │ │ │ │ ├── token │ │ │ │ │ │ └── index.ts │ │ │ │ │ ├── balance │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ └── balance.module.scss │ │ │ │ │ ├── settings │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ ├── tooltip-content.module.scss │ │ │ │ │ │ └── settings.module.scss │ │ │ │ │ ├── amount-input │ │ │ │ │ │ └── index.ts │ │ │ │ │ ├── select-token │ │ │ │ │ │ └── index.ts │ │ │ │ │ ├── transaction-modal │ │ │ │ │ │ └── index.ts │ │ │ │ │ ├── fee-and-time-footer │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ └── fee-and-time-footer.module.scss │ │ │ │ │ ├── pay-vara-fee-button │ │ │ │ │ │ └── index.ts │ │ │ │ │ ├── submit-button │ │ │ │ │ │ └── index.ts │ │ │ │ │ ├── submit-progress-bar │ │ │ │ │ │ └── index.ts │ │ │ │ │ ├── swap-network-button │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ └── swap-network-button.tsx │ │ │ │ │ ├── swap-form │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ ├── swap-eth-form.tsx │ │ │ │ │ │ └── swap-vara-form.tsx │ │ │ │ │ ├── relay-tx-button │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ └── relay-tx-note.module.scss │ │ │ │ │ └── index.ts │ │ │ │ ├── index.ts │ │ │ │ ├── assets │ │ │ │ │ ├── plus.svg │ │ │ │ │ └── circle-check.svg │ │ │ │ ├── hooks │ │ │ │ │ ├── vara │ │ │ │ │ │ ├── use-init-archive-api.ts │ │ │ │ │ │ ├── use-vft-manager-program.ts │ │ │ │ │ │ ├── use-prepare-mint.ts │ │ │ │ │ │ ├── use-historical-proxy-contract-address.ts │ │ │ │ │ │ ├── use-prepare-request-bridging.ts │ │ │ │ │ │ ├── use-prepare-approve.ts │ │ │ │ │ │ └── use-pay-vara-fee.ts │ │ │ │ │ ├── eth │ │ │ │ │ │ └── index.ts │ │ │ │ │ └── index.ts │ │ │ │ └── types │ │ │ │ │ ├── form.ts │ │ │ │ │ └── index.ts │ │ │ ├── wallet │ │ │ │ ├── index.ts │ │ │ │ ├── components │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── wallet │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ └── wallet.module.scss │ │ │ │ │ ├── balance │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ └── balance.module.scss │ │ │ │ │ ├── connect-wallet-button │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ └── connect-wallet-button.module.scss │ │ │ │ │ └── connected-wallet-button │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ └── connected-wallet-button.module.scss │ │ │ │ └── consts.ts │ │ │ ├── history │ │ │ │ ├── components │ │ │ │ │ ├── list │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ └── list.module.scss │ │ │ │ │ ├── block-number-link │ │ │ │ │ │ ├── block-number-link.module.scss │ │ │ │ │ │ └── index.ts │ │ │ │ │ ├── transaction-card │ │ │ │ │ │ └── index.ts │ │ │ │ │ ├── transaction-date │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ └── transaction-date.module.scss │ │ │ │ │ ├── transaction-pair │ │ │ │ │ │ └── index.ts │ │ │ │ │ ├── transaction-status │ │ │ │ │ │ └── index.ts │ │ │ │ │ ├── transactions-counter │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ ├── transactions-counter.module.scss │ │ │ │ │ │ └── transactions-counter.tsx │ │ │ │ │ ├── pending-transactions-warning │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ └── pending-transactions-warning.module.scss │ │ │ │ │ └── index.ts │ │ │ │ ├── graphql │ │ │ │ │ └── index.ts │ │ │ │ ├── utils │ │ │ │ │ └── index.ts │ │ │ │ ├── types.ts │ │ │ │ ├── consts │ │ │ │ │ ├── icons.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ └── queries.ts │ │ │ │ ├── assets │ │ │ │ │ └── check.svg │ │ │ │ └── hooks │ │ │ │ │ ├── use-accounts-filter.ts │ │ │ │ │ └── index.ts │ │ │ ├── faq │ │ │ │ ├── components │ │ │ │ │ ├── index.ts │ │ │ │ │ └── accordion │ │ │ │ │ │ └── index.ts │ │ │ │ ├── index.ts │ │ │ │ └── assets │ │ │ │ │ ├── arrow.svg │ │ │ │ │ └── arrows-double.svg │ │ │ ├── faucet │ │ │ │ ├── index.ts │ │ │ │ ├── components │ │ │ │ │ ├── index.ts │ │ │ │ │ └── get-balance-button │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ └── get-balance-button.module.scss │ │ │ │ ├── consts.ts │ │ │ │ └── assets │ │ │ │ │ └── gift.svg │ │ │ ├── network-switch │ │ │ │ ├── index.ts │ │ │ │ ├── components │ │ │ │ │ ├── dropdown │ │ │ │ │ │ └── index.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ └── network-switch │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ └── network-switch.tsx │ │ │ │ └── assets │ │ │ │ │ ├── spinner.svg │ │ │ │ │ ├── world.svg │ │ │ │ │ └── arrow.svg │ │ │ ├── token-price │ │ │ │ ├── components │ │ │ │ │ ├── index.ts │ │ │ │ │ └── token-price │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ └── token-price.module.scss │ │ │ │ └── index.ts │ │ │ └── token-tracker │ │ │ │ ├── components │ │ │ │ ├── tokens-card │ │ │ │ │ └── index.ts │ │ │ │ ├── balance-card │ │ │ │ │ ├── index.ts │ │ │ │ │ └── balance-card.module.scss │ │ │ │ ├── locked-balance-tooltip │ │ │ │ │ └── index.ts │ │ │ │ └── index.ts │ │ │ │ ├── index.ts │ │ │ │ └── hooks │ │ │ │ ├── index.ts │ │ │ │ └── use-burn-vara-tokens.ts │ │ ├── pages │ │ │ ├── faq │ │ │ │ ├── index.ts │ │ │ │ └── faq.module.scss │ │ │ ├── home │ │ │ │ ├── index.ts │ │ │ │ ├── home.module.scss │ │ │ │ └── home.tsx │ │ │ ├── not-found │ │ │ │ ├── index.ts │ │ │ │ ├── not-found.module.scss │ │ │ │ └── not-found.tsx │ │ │ ├── transaction │ │ │ │ ├── index.ts │ │ │ │ ├── field.tsx │ │ │ │ └── section-card.tsx │ │ │ ├── transactions │ │ │ │ ├── index.ts │ │ │ │ └── transactions.module.scss │ │ │ ├── token-tracker │ │ │ │ ├── index.ts │ │ │ │ ├── token-tracker.module.scss │ │ │ │ └── token-tracker.tsx │ │ │ ├── connect-wallet │ │ │ │ ├── index.ts │ │ │ │ └── connect-wallet.module.scss │ │ │ └── index.tsx │ │ ├── components │ │ │ ├── card │ │ │ │ ├── index.ts │ │ │ │ ├── card.module.scss │ │ │ │ └── card.tsx │ │ │ ├── copy-button │ │ │ │ ├── copy-button.module.scss │ │ │ │ └── index.ts │ │ │ ├── address │ │ │ │ ├── index.ts │ │ │ │ └── address.tsx │ │ │ ├── form │ │ │ │ ├── input │ │ │ │ │ ├── index.ts │ │ │ │ │ └── input.tsx │ │ │ │ ├── radio │ │ │ │ │ ├── index.ts │ │ │ │ │ └── radio.tsx │ │ │ │ ├── select │ │ │ │ │ ├── index.ts │ │ │ │ │ └── select.tsx │ │ │ │ ├── checkbox │ │ │ │ │ ├── index.ts │ │ │ │ │ └── checkbox.tsx │ │ │ │ ├── textarea │ │ │ │ │ └── index.ts │ │ │ │ ├── types.ts │ │ │ │ └── index.ts │ │ │ ├── tooltip │ │ │ │ ├── index.ts │ │ │ │ └── tooltip.module.scss │ │ │ ├── formatted-balance │ │ │ │ ├── formatted-balance.module.scss │ │ │ │ └── index.ts │ │ │ ├── layout │ │ │ │ ├── header │ │ │ │ │ ├── index.ts │ │ │ │ │ └── consts.ts │ │ │ │ ├── container │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── container.module.scss │ │ │ │ │ └── container.tsx │ │ │ │ ├── skeleton │ │ │ │ │ ├── index.ts │ │ │ │ │ └── skeleton.tsx │ │ │ │ ├── error-boundary │ │ │ │ │ ├── index.ts │ │ │ │ │ └── error-boundary.module.scss │ │ │ │ ├── truncated-text │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── truncated-text.module.scss │ │ │ │ │ └── truncated-text.tsx │ │ │ │ └── index.ts │ │ │ ├── token-svg │ │ │ │ ├── index.ts │ │ │ │ └── token-svg.module.scss │ │ │ └── link-button │ │ │ │ └── index.ts │ │ ├── consts │ │ │ ├── env.ts │ │ │ ├── abi │ │ │ │ └── index.ts │ │ │ ├── sails │ │ │ │ └── index.ts │ │ │ ├── routing.ts │ │ │ └── index.ts │ │ ├── vite-env.d.ts │ │ ├── hooks │ │ │ ├── use-eth-account.ts │ │ │ ├── use-vara-symbol.ts │ │ │ ├── common │ │ │ │ ├── use-modal.ts │ │ │ │ ├── index.ts │ │ │ │ ├── use-loading.ts │ │ │ │ ├── use-invalidate-on-block.ts │ │ │ │ └── use-change-effect.ts │ │ │ ├── use-vft-program.ts │ │ │ ├── use-wrapped-vara-program.ts │ │ │ ├── use-vara-account-balance.ts │ │ │ ├── use-eth-account-balance.ts │ │ │ └── use-vara-ft-balance.ts │ │ ├── context │ │ │ ├── index.ts │ │ │ └── network-type │ │ │ │ ├── eth-network-mismatch-modal.module.scss │ │ │ │ ├── types.ts │ │ │ │ └── index.ts │ │ ├── assets │ │ │ ├── search.svg │ │ │ ├── wrapped-vara.svg │ │ │ ├── vara.svg │ │ │ ├── arrow.svg │ │ │ └── eth.svg │ │ ├── utils │ │ │ └── _breakpoints.scss │ │ ├── types │ │ │ └── index.ts │ │ └── app.tsx │ ├── README.md │ ├── tsconfig.node.json │ ├── public │ │ ├── metadata.png │ │ ├── favicons │ │ │ ├── favicon.ico │ │ │ ├── favicon-96x96.png │ │ │ ├── apple-touch-icon.png │ │ │ ├── web-app-manifest-192x192.png │ │ │ └── web-app-manifest-512x512.png │ │ └── site.webmanifest │ ├── eslint.config.js │ ├── prettier.config.js │ ├── tsconfig.app.json │ ├── tsconfig.json │ ├── vite.config.ts │ ├── codegen.ts │ └── .env.example ├── indexer │ ├── src │ │ ├── model │ │ │ ├── index.ts │ │ │ └── entities │ │ │ │ ├── _network.ts │ │ │ │ ├── _status.ts │ │ │ │ ├── ethBridgeProgram.model.ts │ │ │ │ ├── varaBridgeProgram.model.ts │ │ │ │ ├── index.ts │ │ │ │ ├── initiatedTransfer.model.ts │ │ │ │ ├── gearEthBridgeMessage.model.ts │ │ │ │ └── merkleRoot.ts │ │ ├── plugins │ │ │ └── index.ts │ │ ├── common │ │ │ ├── index.ts │ │ │ ├── hash.ts │ │ │ ├── nonce.ts │ │ │ ├── map.ts │ │ │ └── env.ts │ │ ├── gear │ │ │ ├── types │ │ │ │ ├── historical-proxy.ts │ │ │ │ ├── index.ts │ │ │ │ └── bridging-payment.ts │ │ │ └── handlers │ │ │ │ ├── index.ts │ │ │ │ └── eth-bridge.ts │ │ └── eth │ │ │ ├── abi │ │ │ ├── bridging-payment.ts │ │ │ ├── abi.support.ts │ │ │ └── erc20-manager.ts │ │ │ └── config.ts │ ├── scripts │ │ └── abi.js │ ├── db │ │ └── migrations │ │ │ ├── 1760014621133-is_priority_fee_paid.js │ │ │ ├── 1753370188946-comments.js │ │ │ ├── 1761899624812-remove_checkpoint.js │ │ │ └── 1756821384017-amount_is_string.js │ └── tsconfig.json ├── common │ ├── src │ │ ├── index.ts │ │ └── pair-hash.ts │ ├── README.md │ ├── .swcrc │ ├── tsconfig.json │ └── package.json └── bridge-js │ ├── ping │ ├── build.rs │ ├── ping.idl │ └── Cargo.toml │ ├── src │ ├── eth-to-vara │ │ └── index.ts │ ├── vara-to-eth │ │ ├── index.ts │ │ └── util.ts │ ├── util.ts │ ├── ethereum │ │ ├── index.ts │ │ └── helpers.ts │ ├── vara │ │ └── index.ts │ └── index.ts │ ├── .swcrc │ ├── tsconfig.types.json │ ├── vitest.config.ts │ ├── tsconfig.json │ └── js-test │ ├── contracts │ ├── foundry.toml │ ├── src │ │ └── MessageHandler.sol │ └── script │ │ └── Deploy.s.sol │ └── Cargo.toml ├── tests └── src │ ├── relayer │ ├── mod.rs │ └── transactions.json.zst │ ├── checkpoint_light_client │ └── chain-data │ │ ├── headers.json.zst │ │ ├── holesky-update-368.json.zst │ │ └── holesky-bootstrap-368.json.zst │ └── historical_proxy │ └── headers │ ├── holesky-header-2_498_458.json │ ├── holesky-header-2_498_462.json │ ├── holesky-header-2_498_464.json │ ├── holesky-header-2_498_457.json │ ├── holesky-header-2_498_459.json │ ├── holesky-header-2_498_460.json │ ├── holesky-header-2_498_461.json │ └── holesky-header-2_498_463.json ├── circuits ├── plonky2_blake2b256 │ ├── src │ │ └── lib.rs │ └── Cargo.toml ├── plonky2_sha512 │ ├── src │ │ └── lib.rs │ └── Cargo.toml ├── plonky2_ed25519 │ └── src │ │ ├── field │ │ └── mod.rs │ │ ├── curve │ │ └── mod.rs │ │ ├── gadgets │ │ └── mod.rs │ │ └── lib.rs ├── plonky2_u32 │ ├── src │ │ ├── gadgets │ │ │ └── mod.rs │ │ ├── gates │ │ │ └── mod.rs │ │ └── lib.rs │ └── Cargo.toml └── plonky2_ecdsa │ ├── src │ ├── lib.rs │ ├── curve │ │ └── mod.rs │ └── gadgets │ │ └── mod.rs │ └── Cargo.toml ├── mock-contract ├── build.rs ├── README.md ├── src │ └── lib.rs └── Cargo.toml ├── audits ├── ethernal.pdf └── ethernal_2.pdf ├── gear-programs ├── proof-storage │ ├── build.rs │ └── Cargo.toml ├── vft │ ├── client │ │ ├── src │ │ │ └── lib.rs │ │ ├── Cargo.toml │ │ └── build.rs │ ├── app │ │ └── Cargo.toml │ ├── Cargo.toml │ ├── src │ │ └── lib.rs │ ├── README.md │ └── build.rs ├── vft-vara │ ├── client │ │ ├── src │ │ │ └── lib.rs │ │ ├── Cargo.toml │ │ └── build.rs │ ├── app │ │ └── Cargo.toml │ ├── Cargo.toml │ ├── src │ │ └── lib.rs │ ├── README.md │ └── build.rs ├── vft-manager │ ├── client │ │ ├── src │ │ │ └── lib.rs │ │ ├── Cargo.toml │ │ └── build.rs │ ├── app │ │ ├── src │ │ │ └── services │ │ │ │ └── submit_receipt │ │ │ │ └── abi.rs │ │ └── build.rs │ ├── src │ │ └── lib.rs │ ├── Cargo.toml │ ├── README.md │ └── build.rs ├── bridging-payment │ ├── client │ │ ├── src │ │ │ └── lib.rs │ │ ├── Cargo.toml │ │ └── build.rs │ ├── app │ │ ├── Cargo.toml │ │ └── src │ │ │ └── lib.rs │ ├── Cargo.toml │ ├── src │ │ └── lib.rs │ ├── README.md │ └── build.rs ├── eth-events-deneb │ ├── client │ │ ├── src │ │ │ └── lib.rs │ │ └── Cargo.toml │ ├── app │ │ ├── src │ │ │ └── lib.rs │ │ └── Cargo.toml │ ├── Cargo.toml │ ├── src │ │ └── lib.rs │ ├── README.md │ └── build.rs ├── historical-proxy │ ├── client │ │ ├── src │ │ │ └── lib.rs │ │ ├── Cargo.toml │ │ └── build.rs │ ├── src │ │ └── lib.rs │ ├── README.md │ ├── Cargo.toml │ ├── build.rs │ └── app │ │ └── src │ │ └── error.rs ├── eth-events-electra │ ├── client │ │ ├── src │ │ │ └── lib.rs │ │ └── Cargo.toml │ ├── app │ │ ├── src │ │ │ └── lib.rs │ │ └── Cargo.toml │ ├── Cargo.toml │ ├── src │ │ └── lib.rs │ ├── README.md │ └── build.rs ├── checkpoint-light-client │ ├── client │ │ ├── src │ │ │ └── lib.rs │ │ └── Cargo.toml │ ├── Cargo.toml │ ├── src │ │ └── lib.rs │ ├── io │ │ └── Cargo.toml │ ├── README.md │ ├── app │ │ └── src │ │ │ └── services │ │ │ ├── mod.rs │ │ │ └── checkpoint.rs │ └── build.rs ├── eth-events-common │ └── Cargo.toml └── vft-common │ └── Cargo.toml ├── rustfmt.toml ├── rust-toolchain.toml ├── images ├── block_diagram.png ├── eth_gear_transfer.png ├── gear_eth_transfer.png ├── prover │ ├── FinalProof.png │ ├── BlockFinality.png │ ├── LeafNodeParser.png │ ├── BranchNodeParser.png │ └── BlockStorageInclusion.png ├── block_diagram_simplified.png └── coverage │ ├── lcov-report-main.png │ ├── lcov-report-test.png │ ├── lcov-report-libraries.png │ ├── lcov-report-test-Base.png │ └── lcov-report-libraries-PlonkVerifier.png ├── prover └── src │ └── common │ └── poseidon_bn128 │ ├── mod.rs │ └── fr.rs ├── relayer ├── src │ ├── message_relayer │ │ ├── mod.rs │ │ ├── gear_to_eth │ │ │ └── mod.rs │ │ └── common │ │ │ ├── gear │ │ │ └── mod.rs │ │ │ └── ethereum │ │ │ └── mod.rs │ ├── lib.rs │ └── hex_utils.rs └── build.rs ├── .yarnrc.yml ├── .cargo └── config.toml ├── tools ├── governance │ ├── deployment.example.toml │ ├── deployment.example.mainnet.toml │ ├── deployment.example.hoodi.toml │ └── Cargo.toml ├── genesis-config │ └── Cargo.toml ├── deploy-to-gear │ └── Cargo.toml └── vft-manager-tool │ └── Cargo.toml ├── lerna.json ├── utils-prometheus └── Cargo.toml ├── .prettierrc ├── ethereum ├── src │ ├── erc20 │ │ └── interfaces │ │ │ ├── ICircleToken.sol │ │ │ └── ITetherToken.sol │ ├── interfaces │ │ ├── IERC20Mintable.sol │ │ ├── IPausable.sol │ │ ├── IUUPSUpgradeable.sol │ │ ├── IVerifierMock.sol │ │ ├── IMessageHandler.sol │ │ ├── IMessageHandlerMock.sol │ │ └── IPlonkVerifier.sol │ └── mocks │ │ └── NewImplementationMock.sol ├── script │ ├── Deployment.s.sol │ └── upgrades │ │ ├── WrappedVara.s.sol │ │ ├── ERC20Manager.s.sol │ │ ├── MessageQueue.s.sol │ │ ├── VerifierMock.s.sol │ │ ├── VerifierMainnet.s.sol │ │ └── VerifierTestnet.s.sol ├── client │ └── Cargo.toml ├── remappings.txt ├── test │ └── script │ │ └── upgrades │ │ ├── WrappedVara.t.sol │ │ ├── ERC20Manager.t.sol │ │ ├── MessageQueue.t.sol │ │ ├── VerifierMock.t.sol │ │ ├── VerifierMainnet.t.sol │ │ └── VerifierTestnet.t.sol └── foundry.lock ├── api └── README.md ├── gear-common └── Cargo.toml ├── ethereum-common └── src │ ├── memory_db.rs │ ├── beacon │ └── mod.rs │ ├── base_types │ └── mod.rs │ └── keccak_hasher.rs ├── Dockerfile.dockerignore ├── ethereum_beacon_client └── Cargo.toml ├── gear-rpc-client └── src │ └── metadata │ └── mod.rs └── .gitignore /.envrc: -------------------------------------------------------------------------------- 1 | use flake 2 | -------------------------------------------------------------------------------- /js/frontend/src/features/swap/consts/env.ts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /js/frontend/README.md: -------------------------------------------------------------------------------- 1 | # Vara Network Bridge 2 | -------------------------------------------------------------------------------- /js/indexer/src/model/index.ts: -------------------------------------------------------------------------------- 1 | export * from './entities/index.js'; 2 | -------------------------------------------------------------------------------- /tests/src/relayer/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod eth_to_gear; 2 | pub mod upload; 3 | -------------------------------------------------------------------------------- /circuits/plonky2_blake2b256/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod circuit; 2 | mod utils; 3 | -------------------------------------------------------------------------------- /js/common/src/index.ts: -------------------------------------------------------------------------------- 1 | export { createPairHash } from './pair-hash.js'; 2 | -------------------------------------------------------------------------------- /js/bridge-js/ping/build.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | sails_rs::build_wasm(); 3 | } 4 | -------------------------------------------------------------------------------- /mock-contract/build.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | gear_wasm_builder::build(); 3 | } 4 | -------------------------------------------------------------------------------- /js/common/README.md: -------------------------------------------------------------------------------- 1 | # Common 2 | 3 | Shared utilities for the Gear Bridges project. 4 | -------------------------------------------------------------------------------- /js/frontend/src/pages/faq/index.ts: -------------------------------------------------------------------------------- 1 | import { FAQ } from './faq'; 2 | 3 | export { FAQ }; 4 | -------------------------------------------------------------------------------- /audits/ethernal.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gear-tech/gear-bridges/HEAD/audits/ethernal.pdf -------------------------------------------------------------------------------- /gear-programs/proof-storage/build.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | gear_wasm_builder::build(); 3 | } 4 | -------------------------------------------------------------------------------- /js/frontend/src/pages/home/index.ts: -------------------------------------------------------------------------------- 1 | import { Home } from './home'; 2 | 3 | export { Home }; 4 | -------------------------------------------------------------------------------- /rustfmt.toml: -------------------------------------------------------------------------------- 1 | edition = "2021" 2 | imports_granularity = "Crate" 3 | style_edition = "2021" 4 | -------------------------------------------------------------------------------- /audits/ethernal_2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gear-tech/gear-bridges/HEAD/audits/ethernal_2.pdf -------------------------------------------------------------------------------- /js/frontend/src/components/card/index.ts: -------------------------------------------------------------------------------- 1 | import { Card } from './card'; 2 | 3 | export { Card }; 4 | -------------------------------------------------------------------------------- /rust-toolchain.toml: -------------------------------------------------------------------------------- 1 | [toolchain] 2 | channel = "nightly-2025-06-06" 3 | targets = ["wasm32v1-none" ] 4 | -------------------------------------------------------------------------------- /images/block_diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gear-tech/gear-bridges/HEAD/images/block_diagram.png -------------------------------------------------------------------------------- /js/frontend/src/components/copy-button/copy-button.module.scss: -------------------------------------------------------------------------------- 1 | .button { 2 | color: #00ffc4; 3 | } 4 | -------------------------------------------------------------------------------- /js/frontend/tsconfig.node.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@gear-js/frontend-configs/tsconfig.node.json" 3 | } 4 | -------------------------------------------------------------------------------- /circuits/plonky2_sha512/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![allow(clippy::all)] 2 | 3 | pub mod circuit; 4 | pub mod split_base; 5 | -------------------------------------------------------------------------------- /js/frontend/src/components/address/index.ts: -------------------------------------------------------------------------------- 1 | import { Address } from './address'; 2 | 3 | export { Address }; 4 | -------------------------------------------------------------------------------- /js/frontend/src/components/form/input/index.ts: -------------------------------------------------------------------------------- 1 | import { Input } from './input'; 2 | 3 | export { Input }; 4 | -------------------------------------------------------------------------------- /js/frontend/src/components/form/radio/index.ts: -------------------------------------------------------------------------------- 1 | import { Radio } from './radio'; 2 | 3 | export { Radio }; 4 | -------------------------------------------------------------------------------- /js/frontend/src/components/tooltip/index.ts: -------------------------------------------------------------------------------- 1 | import { Tooltip } from './tooltip'; 2 | 3 | export { Tooltip }; 4 | -------------------------------------------------------------------------------- /js/frontend/src/features/wallet/index.ts: -------------------------------------------------------------------------------- 1 | import { Wallet } from './components'; 2 | 3 | export { Wallet }; 4 | -------------------------------------------------------------------------------- /prover/src/common/poseidon_bn128/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod config; 2 | mod constants; 3 | mod fr; 4 | mod permution; 5 | -------------------------------------------------------------------------------- /relayer/src/message_relayer/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod common; 2 | 3 | pub mod eth_to_gear; 4 | pub mod gear_to_eth; 5 | -------------------------------------------------------------------------------- /circuits/plonky2_ed25519/src/field/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod ed25519_base; 2 | pub mod ed25519_scalar; 3 | mod field_testing; 4 | -------------------------------------------------------------------------------- /images/eth_gear_transfer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gear-tech/gear-bridges/HEAD/images/eth_gear_transfer.png -------------------------------------------------------------------------------- /images/gear_eth_transfer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gear-tech/gear-bridges/HEAD/images/gear_eth_transfer.png -------------------------------------------------------------------------------- /images/prover/FinalProof.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gear-tech/gear-bridges/HEAD/images/prover/FinalProof.png -------------------------------------------------------------------------------- /js/bridge-js/src/eth-to-vara/index.ts: -------------------------------------------------------------------------------- 1 | export { relayEthToVara, type RelayEthToVaraParams } from './relayer.js'; 2 | -------------------------------------------------------------------------------- /js/bridge-js/src/vara-to-eth/index.ts: -------------------------------------------------------------------------------- 1 | export { relayVaraToEth, type RelayVaraToEthParams } from './relayer.js'; 2 | -------------------------------------------------------------------------------- /js/frontend/src/components/form/select/index.ts: -------------------------------------------------------------------------------- 1 | import { Select } from './select'; 2 | 3 | export { Select }; 4 | -------------------------------------------------------------------------------- /js/frontend/src/components/formatted-balance/formatted-balance.module.scss: -------------------------------------------------------------------------------- 1 | .text { 2 | display: block; 3 | } 4 | -------------------------------------------------------------------------------- /js/frontend/src/components/layout/header/index.ts: -------------------------------------------------------------------------------- 1 | import { Header } from './header'; 2 | 3 | export { Header }; 4 | -------------------------------------------------------------------------------- /js/frontend/src/features/history/components/list/index.ts: -------------------------------------------------------------------------------- 1 | import { List } from './list'; 2 | 3 | export { List }; 4 | -------------------------------------------------------------------------------- /js/frontend/src/features/history/graphql/index.ts: -------------------------------------------------------------------------------- 1 | export * from './fragment-masking'; 2 | export * from './gql'; 3 | -------------------------------------------------------------------------------- /js/frontend/src/features/swap/components/swap/index.ts: -------------------------------------------------------------------------------- 1 | import { Swap } from './swap'; 2 | 3 | export { Swap }; 4 | -------------------------------------------------------------------------------- /js/frontend/src/features/wallet/components/index.ts: -------------------------------------------------------------------------------- 1 | import { Wallet } from './wallet'; 2 | 3 | export { Wallet }; 4 | -------------------------------------------------------------------------------- /js/frontend/src/pages/not-found/index.ts: -------------------------------------------------------------------------------- 1 | import { NotFound } from './not-found'; 2 | 3 | export { NotFound }; 4 | -------------------------------------------------------------------------------- /images/prover/BlockFinality.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gear-tech/gear-bridges/HEAD/images/prover/BlockFinality.png -------------------------------------------------------------------------------- /images/prover/LeafNodeParser.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gear-tech/gear-bridges/HEAD/images/prover/LeafNodeParser.png -------------------------------------------------------------------------------- /js/frontend/public/metadata.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gear-tech/gear-bridges/HEAD/js/frontend/public/metadata.png -------------------------------------------------------------------------------- /js/frontend/src/components/form/checkbox/index.ts: -------------------------------------------------------------------------------- 1 | import { Checkbox } from './checkbox'; 2 | 3 | export { Checkbox }; 4 | -------------------------------------------------------------------------------- /js/frontend/src/components/form/textarea/index.ts: -------------------------------------------------------------------------------- 1 | import { Textarea } from './textarea'; 2 | 3 | export { Textarea }; 4 | -------------------------------------------------------------------------------- /js/frontend/src/components/token-svg/index.ts: -------------------------------------------------------------------------------- 1 | import { TokenSVG } from './token-svg'; 2 | 3 | export { TokenSVG }; 4 | -------------------------------------------------------------------------------- /js/frontend/src/features/swap/components/token/index.ts: -------------------------------------------------------------------------------- 1 | import { Token } from './token'; 2 | 3 | export { Token }; 4 | -------------------------------------------------------------------------------- /js/indexer/src/model/entities/_network.ts: -------------------------------------------------------------------------------- 1 | export enum Network { 2 | Ethereum = 'Ethereum', 3 | Vara = 'Vara', 4 | } 5 | -------------------------------------------------------------------------------- /.yarnrc.yml: -------------------------------------------------------------------------------- 1 | nodeLinker: node-modules 2 | 3 | yarnPath: .yarn/releases/yarn-4.9.2.cjs 4 | 5 | defaultSemverRangePrefix: '' 6 | -------------------------------------------------------------------------------- /circuits/plonky2_u32/src/gadgets/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod arithmetic_u32; 2 | pub mod multiple_comparison; 3 | pub mod range_check; 4 | -------------------------------------------------------------------------------- /images/block_diagram_simplified.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gear-tech/gear-bridges/HEAD/images/block_diagram_simplified.png -------------------------------------------------------------------------------- /images/prover/BranchNodeParser.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gear-tech/gear-bridges/HEAD/images/prover/BranchNodeParser.png -------------------------------------------------------------------------------- /js/bridge-js/src/util.ts: -------------------------------------------------------------------------------- 1 | export type StatusCb = (status: string, details?: Record) => void | Promise; 2 | -------------------------------------------------------------------------------- /js/frontend/eslint.config.js: -------------------------------------------------------------------------------- 1 | import { eslintConfig } from "@gear-js/frontend-configs"; 2 | 3 | export default eslintConfig; 4 | -------------------------------------------------------------------------------- /js/frontend/src/components/copy-button/index.ts: -------------------------------------------------------------------------------- 1 | import { CopyButton } from './copy-button'; 2 | 3 | export { CopyButton }; 4 | -------------------------------------------------------------------------------- /js/frontend/src/components/layout/container/index.ts: -------------------------------------------------------------------------------- 1 | import { Container } from './container'; 2 | 3 | export { Container }; 4 | -------------------------------------------------------------------------------- /js/frontend/src/components/layout/skeleton/index.ts: -------------------------------------------------------------------------------- 1 | import { Skeleton } from './skeleton'; 2 | 3 | export { Skeleton }; 4 | -------------------------------------------------------------------------------- /js/frontend/src/components/link-button/index.ts: -------------------------------------------------------------------------------- 1 | import { LinkButton } from './link-button'; 2 | 3 | export { LinkButton }; 4 | -------------------------------------------------------------------------------- /js/frontend/src/consts/env.ts: -------------------------------------------------------------------------------- 1 | const GTM_ID = import.meta.env.VITE_GTM_ID as string | undefined; 2 | 3 | export { GTM_ID }; 4 | -------------------------------------------------------------------------------- /js/frontend/src/features/faq/components/index.ts: -------------------------------------------------------------------------------- 1 | import { Accordion } from './accordion'; 2 | 3 | export { Accordion }; 4 | -------------------------------------------------------------------------------- /js/frontend/src/features/swap/components/balance/index.ts: -------------------------------------------------------------------------------- 1 | import { Balance } from './balance'; 2 | 3 | export { Balance }; 4 | -------------------------------------------------------------------------------- /js/frontend/src/features/wallet/components/wallet/index.ts: -------------------------------------------------------------------------------- 1 | import { Wallet } from './wallet'; 2 | 3 | export { Wallet }; 4 | -------------------------------------------------------------------------------- /js/frontend/src/pages/transaction/index.ts: -------------------------------------------------------------------------------- 1 | import { Transaction } from './transaction'; 2 | 3 | export { Transaction }; 4 | -------------------------------------------------------------------------------- /js/frontend/src/pages/transactions/index.ts: -------------------------------------------------------------------------------- 1 | import { Transactions } from './transactions'; 2 | 3 | export { Transactions }; 4 | -------------------------------------------------------------------------------- /js/frontend/src/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | -------------------------------------------------------------------------------- /images/coverage/lcov-report-main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gear-tech/gear-bridges/HEAD/images/coverage/lcov-report-main.png -------------------------------------------------------------------------------- /images/coverage/lcov-report-test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gear-tech/gear-bridges/HEAD/images/coverage/lcov-report-test.png -------------------------------------------------------------------------------- /js/frontend/src/features/faucet/index.ts: -------------------------------------------------------------------------------- 1 | import { GetBalanceButton } from './components'; 2 | 3 | export { GetBalanceButton }; 4 | -------------------------------------------------------------------------------- /js/frontend/src/features/history/components/block-number-link/block-number-link.module.scss: -------------------------------------------------------------------------------- 1 | .link { 2 | color: #00ffc4; 3 | } 4 | -------------------------------------------------------------------------------- /js/frontend/src/features/network-switch/index.ts: -------------------------------------------------------------------------------- 1 | import { NetworkSwitch } from './components'; 2 | 3 | export { NetworkSwitch }; 4 | -------------------------------------------------------------------------------- /js/frontend/src/features/swap/components/settings/index.ts: -------------------------------------------------------------------------------- 1 | import { Settings } from './settings'; 2 | 3 | export { Settings }; 4 | -------------------------------------------------------------------------------- /js/frontend/src/features/wallet/components/balance/index.ts: -------------------------------------------------------------------------------- 1 | import { Balance } from './balance'; 2 | 3 | export { Balance }; 4 | -------------------------------------------------------------------------------- /js/frontend/src/hooks/use-eth-account.ts: -------------------------------------------------------------------------------- 1 | import { useAccount as useEthAccount } from 'wagmi'; 2 | 3 | export { useEthAccount }; 4 | -------------------------------------------------------------------------------- /js/frontend/src/pages/token-tracker/index.ts: -------------------------------------------------------------------------------- 1 | import { TokenTracker } from './token-tracker'; 2 | 3 | export { TokenTracker }; 4 | -------------------------------------------------------------------------------- /images/prover/BlockStorageInclusion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gear-tech/gear-bridges/HEAD/images/prover/BlockStorageInclusion.png -------------------------------------------------------------------------------- /js/frontend/prettier.config.js: -------------------------------------------------------------------------------- 1 | import { prettierConfig } from "@gear-js/frontend-configs"; 2 | 3 | export default prettierConfig; 4 | -------------------------------------------------------------------------------- /js/frontend/public/favicons/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gear-tech/gear-bridges/HEAD/js/frontend/public/favicons/favicon.ico -------------------------------------------------------------------------------- /js/frontend/src/features/faq/components/accordion/index.ts: -------------------------------------------------------------------------------- 1 | import { Accordion } from './accordion'; 2 | 3 | export { Accordion }; 4 | -------------------------------------------------------------------------------- /js/frontend/src/features/token-price/components/index.ts: -------------------------------------------------------------------------------- 1 | import { TokenPrice } from './token-price'; 2 | 3 | export { TokenPrice }; 4 | -------------------------------------------------------------------------------- /js/frontend/src/pages/connect-wallet/index.ts: -------------------------------------------------------------------------------- 1 | import { ConnectWallet } from './connect-wallet'; 2 | 3 | export { ConnectWallet }; 4 | -------------------------------------------------------------------------------- /js/frontend/src/pages/home/home.module.scss: -------------------------------------------------------------------------------- 1 | .container { 2 | display: flex; 3 | flex-direction: column; 4 | gap: 16px; 5 | } 6 | -------------------------------------------------------------------------------- /js/indexer/src/plugins/index.ts: -------------------------------------------------------------------------------- 1 | export * from './limit.js'; 2 | export * from './transferCount.js'; 3 | export * from './query.js'; 4 | -------------------------------------------------------------------------------- /tests/src/relayer/transactions.json.zst: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gear-tech/gear-bridges/HEAD/tests/src/relayer/transactions.json.zst -------------------------------------------------------------------------------- /images/coverage/lcov-report-libraries.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gear-tech/gear-bridges/HEAD/images/coverage/lcov-report-libraries.png -------------------------------------------------------------------------------- /images/coverage/lcov-report-test-Base.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gear-tech/gear-bridges/HEAD/images/coverage/lcov-report-test-Base.png -------------------------------------------------------------------------------- /js/frontend/src/context/index.ts: -------------------------------------------------------------------------------- 1 | import { Token, useTokens } from './tokens'; 2 | 3 | export { useTokens }; 4 | export type { Token }; 5 | -------------------------------------------------------------------------------- /js/frontend/src/features/network-switch/components/dropdown/index.ts: -------------------------------------------------------------------------------- 1 | import { Dropdown } from './dropdown'; 2 | 3 | export { Dropdown }; 4 | -------------------------------------------------------------------------------- /js/frontend/public/favicons/favicon-96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gear-tech/gear-bridges/HEAD/js/frontend/public/favicons/favicon-96x96.png -------------------------------------------------------------------------------- /js/frontend/src/components/layout/error-boundary/index.ts: -------------------------------------------------------------------------------- 1 | import { ErrorBoundary } from './error-boundary'; 2 | 3 | export { ErrorBoundary }; 4 | -------------------------------------------------------------------------------- /js/frontend/src/components/layout/truncated-text/index.ts: -------------------------------------------------------------------------------- 1 | import { TruncatedText } from './truncated-text'; 2 | 3 | export { TruncatedText }; 4 | -------------------------------------------------------------------------------- /js/frontend/src/features/network-switch/components/index.ts: -------------------------------------------------------------------------------- 1 | import { NetworkSwitch } from './network-switch'; 2 | 3 | export { NetworkSwitch }; 4 | -------------------------------------------------------------------------------- /js/frontend/src/features/swap/components/amount-input/index.ts: -------------------------------------------------------------------------------- 1 | import { AmountInput } from './amount-input'; 2 | 3 | export { AmountInput }; 4 | -------------------------------------------------------------------------------- /js/frontend/src/features/swap/components/select-token/index.ts: -------------------------------------------------------------------------------- 1 | import { SelectToken } from './select-token'; 2 | 3 | export { SelectToken }; 4 | -------------------------------------------------------------------------------- /js/frontend/src/features/token-price/components/token-price/index.ts: -------------------------------------------------------------------------------- 1 | import { TokenPrice } from './token-price'; 2 | 3 | export { TokenPrice }; 4 | -------------------------------------------------------------------------------- /js/frontend/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@gear-js/frontend-configs/tsconfig.app.json", 3 | "include": ["src", "codegen.ts"] 4 | } 5 | -------------------------------------------------------------------------------- /js/frontend/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [], 3 | "references": [{ "path": "./tsconfig.app.json" }, { "path": "./tsconfig.node.json" }] 4 | } 5 | -------------------------------------------------------------------------------- /js/frontend/src/components/formatted-balance/index.ts: -------------------------------------------------------------------------------- 1 | import { FormattedBalance } from './formatted-balance'; 2 | 3 | export { FormattedBalance }; 4 | -------------------------------------------------------------------------------- /js/frontend/src/features/faucet/components/index.ts: -------------------------------------------------------------------------------- 1 | import { GetBalanceButton } from './get-balance-button'; 2 | 3 | export { GetBalanceButton }; 4 | -------------------------------------------------------------------------------- /js/frontend/src/features/token-tracker/components/tokens-card/index.ts: -------------------------------------------------------------------------------- 1 | import { TokensCard } from './tokens-card'; 2 | 3 | export { TokensCard }; 4 | -------------------------------------------------------------------------------- /js/frontend/public/favicons/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gear-tech/gear-bridges/HEAD/js/frontend/public/favicons/apple-touch-icon.png -------------------------------------------------------------------------------- /js/frontend/src/features/faucet/consts.ts: -------------------------------------------------------------------------------- 1 | const HCAPTCHA_SITEKEY = import.meta.env.VITE_HCAPTCHA_SITEKEY as string; 2 | 3 | export { HCAPTCHA_SITEKEY }; 4 | -------------------------------------------------------------------------------- /js/frontend/src/features/token-tracker/components/balance-card/index.ts: -------------------------------------------------------------------------------- 1 | import { BalanceCard } from './balance-card'; 2 | 3 | export { BalanceCard }; 4 | -------------------------------------------------------------------------------- /js/frontend/src/features/network-switch/components/network-switch/index.ts: -------------------------------------------------------------------------------- 1 | import { NetworkSwitch } from './network-switch'; 2 | 3 | export { NetworkSwitch }; 4 | -------------------------------------------------------------------------------- /.cargo/config.toml: -------------------------------------------------------------------------------- 1 | # TODO: remove when https://github.com/gear-tech/gear/pull/4798 is released 2 | [env] 3 | GEAR_WORKSPACE_DIR = { value = "", relative = true } 4 | -------------------------------------------------------------------------------- /circuits/plonky2_ed25519/src/curve/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod curve_adds; 2 | pub mod curve_multiplication; 3 | pub mod curve_types; 4 | pub mod ed25519; 5 | pub mod eddsa; 6 | -------------------------------------------------------------------------------- /images/coverage/lcov-report-libraries-PlonkVerifier.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gear-tech/gear-bridges/HEAD/images/coverage/lcov-report-libraries-PlonkVerifier.png -------------------------------------------------------------------------------- /js/frontend/src/features/faq/index.ts: -------------------------------------------------------------------------------- 1 | import { Accordion } from './components'; 2 | import { QUESTIONS } from './consts'; 3 | 4 | export { Accordion, QUESTIONS }; 5 | -------------------------------------------------------------------------------- /js/frontend/src/features/history/components/block-number-link/index.ts: -------------------------------------------------------------------------------- 1 | import { BlockNumberLink } from './block-number-link'; 2 | 3 | export { BlockNumberLink }; 4 | -------------------------------------------------------------------------------- /js/frontend/src/features/history/components/transaction-card/index.ts: -------------------------------------------------------------------------------- 1 | import { TransactionCard } from './transaction-card'; 2 | 3 | export { TransactionCard }; 4 | -------------------------------------------------------------------------------- /js/frontend/src/features/history/components/transaction-date/index.ts: -------------------------------------------------------------------------------- 1 | import { TransactionDate } from './transaction-date'; 2 | 3 | export { TransactionDate }; 4 | -------------------------------------------------------------------------------- /js/frontend/src/features/history/components/transaction-pair/index.ts: -------------------------------------------------------------------------------- 1 | import { TransactionPair } from './transaction-pair'; 2 | 3 | export { TransactionPair }; 4 | -------------------------------------------------------------------------------- /js/frontend/src/features/swap/components/transaction-modal/index.ts: -------------------------------------------------------------------------------- 1 | import { TransactionModal } from './transaction-modal'; 2 | 3 | export { TransactionModal }; 4 | -------------------------------------------------------------------------------- /circuits/plonky2_u32/src/gates/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod add_many_u32; 2 | pub mod arithmetic_u32; 3 | pub mod comparison; 4 | pub mod range_check_u32; 5 | pub mod subtraction_u32; 6 | -------------------------------------------------------------------------------- /gear-programs/vft/client/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | 3 | // Incorporate code generated based on the IDL file 4 | include!(concat!(env!("OUT_DIR"), "/vft_client.rs")); 5 | -------------------------------------------------------------------------------- /js/frontend/public/favicons/web-app-manifest-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gear-tech/gear-bridges/HEAD/js/frontend/public/favicons/web-app-manifest-192x192.png -------------------------------------------------------------------------------- /js/frontend/public/favicons/web-app-manifest-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gear-tech/gear-bridges/HEAD/js/frontend/public/favicons/web-app-manifest-512x512.png -------------------------------------------------------------------------------- /js/frontend/src/features/faucet/components/get-balance-button/index.ts: -------------------------------------------------------------------------------- 1 | import { GetBalanceButton } from './get-balance-button'; 2 | 3 | export { GetBalanceButton }; 4 | -------------------------------------------------------------------------------- /js/frontend/src/features/history/components/transaction-status/index.ts: -------------------------------------------------------------------------------- 1 | import { TransactionStatus } from './transaction-status'; 2 | 3 | export { TransactionStatus }; 4 | -------------------------------------------------------------------------------- /js/frontend/src/features/swap/components/fee-and-time-footer/index.ts: -------------------------------------------------------------------------------- 1 | import { FeeAndTimeFooter } from './fee-and-time-footer'; 2 | 3 | export { FeeAndTimeFooter }; 4 | -------------------------------------------------------------------------------- /js/frontend/src/features/swap/components/pay-vara-fee-button/index.ts: -------------------------------------------------------------------------------- 1 | import { PayVaraFeeButton } from './pay-vara-fee-button'; 2 | 3 | export { PayVaraFeeButton }; 4 | -------------------------------------------------------------------------------- /js/frontend/src/features/swap/components/submit-button/index.ts: -------------------------------------------------------------------------------- 1 | import { ConnectWalletButton } from './connect-wallet-button'; 2 | 3 | export { ConnectWalletButton }; 4 | -------------------------------------------------------------------------------- /js/frontend/src/features/swap/components/submit-progress-bar/index.ts: -------------------------------------------------------------------------------- 1 | import { SubmitProgressBar } from './submit-progress-bar'; 2 | 3 | export { SubmitProgressBar }; 4 | -------------------------------------------------------------------------------- /js/frontend/src/features/swap/components/swap-network-button/index.ts: -------------------------------------------------------------------------------- 1 | import { SwapNetworkButton } from './swap-network-button'; 2 | 3 | export { SwapNetworkButton }; 4 | -------------------------------------------------------------------------------- /js/frontend/src/features/token-price/index.ts: -------------------------------------------------------------------------------- 1 | import { TOKEN_ID } from './api'; 2 | import { TokenPrice } from './components'; 3 | 4 | export { TokenPrice, TOKEN_ID }; 5 | -------------------------------------------------------------------------------- /js/frontend/src/features/token-tracker/index.ts: -------------------------------------------------------------------------------- 1 | import { LockedBalanceTooltip, TokensCard } from './components'; 2 | 3 | export { LockedBalanceTooltip, TokensCard }; 4 | -------------------------------------------------------------------------------- /relayer/src/message_relayer/gear_to_eth/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod all_token_transfers; 2 | pub mod manual; 3 | pub mod paid_token_transfers; 4 | pub mod storage; 5 | pub mod tx_manager; 6 | -------------------------------------------------------------------------------- /tools/governance/deployment.example.toml: -------------------------------------------------------------------------------- 1 | GovernanceAdmin = "0x0000000000000000000000000000000000000000" 2 | GovernancePauser = "0x0000000000000000000000000000000000000000" 3 | -------------------------------------------------------------------------------- /gear-programs/vft-vara/client/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | 3 | // Incorporate code generated based on the IDL file 4 | include!(concat!(env!("OUT_DIR"), "/vft_vara_client.rs")); 5 | -------------------------------------------------------------------------------- /js/frontend/src/consts/abi/index.ts: -------------------------------------------------------------------------------- 1 | import { ERC20_ABI } from './erc20-abi'; 2 | import { WRAPPED_ETH_ABI } from './wrapped-eth'; 3 | 4 | export { ERC20_ABI, WRAPPED_ETH_ABI }; 5 | -------------------------------------------------------------------------------- /js/frontend/src/features/history/components/transactions-counter/index.ts: -------------------------------------------------------------------------------- 1 | import { TransactionsCounter } from './transactions-counter'; 2 | 3 | export { TransactionsCounter }; 4 | -------------------------------------------------------------------------------- /js/frontend/src/features/history/utils/index.ts: -------------------------------------------------------------------------------- 1 | import { getLastDaysISOTimestamp, getAssetOptions } from './filters'; 2 | 3 | export { getLastDaysISOTimestamp, getAssetOptions }; 4 | -------------------------------------------------------------------------------- /js/frontend/src/features/wallet/components/connect-wallet-button/index.ts: -------------------------------------------------------------------------------- 1 | import { ConnectWalletButton } from './connect-wallet-button'; 2 | 3 | export { ConnectWalletButton }; 4 | -------------------------------------------------------------------------------- /mock-contract/README.md: -------------------------------------------------------------------------------- 1 | # mock-contract 2 | 3 | Simple contract which you can modify to include mock data for your tests. 4 | 5 | At the moment used to mock checkpoint light client. -------------------------------------------------------------------------------- /tests/src/checkpoint_light_client/chain-data/headers.json.zst: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gear-tech/gear-bridges/HEAD/tests/src/checkpoint_light_client/chain-data/headers.json.zst -------------------------------------------------------------------------------- /circuits/plonky2_ecdsa/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![allow(clippy::needless_range_loop)] 2 | #![cfg_attr(not(test), no_std)] 3 | 4 | extern crate alloc; 5 | 6 | pub mod curve; 7 | pub mod gadgets; 8 | -------------------------------------------------------------------------------- /circuits/plonky2_u32/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![allow(clippy::needless_range_loop)] 2 | #![no_std] 3 | 4 | extern crate alloc; 5 | 6 | pub mod gadgets; 7 | pub mod gates; 8 | pub mod witness; 9 | -------------------------------------------------------------------------------- /gear-programs/vft-manager/client/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | 3 | // Incorporate code generated based on the IDL file 4 | include!(concat!(env!("OUT_DIR"), "/vft_manager_client.rs")); 5 | -------------------------------------------------------------------------------- /js/frontend/src/components/card/card.module.scss: -------------------------------------------------------------------------------- 1 | .card { 2 | padding: 20px 24px; 3 | 4 | background-color: #0e121766; 5 | border: 1px solid #ffffff0a; 6 | border-radius: 8px; 7 | } 8 | -------------------------------------------------------------------------------- /js/frontend/src/features/faucet/components/get-balance-button/get-balance-button.module.scss: -------------------------------------------------------------------------------- 1 | .button { 2 | --font-size: 14px; 3 | --padding: 4px 8px; 4 | --spinner-size: 14px; 5 | } 6 | -------------------------------------------------------------------------------- /js/frontend/src/features/token-tracker/components/locked-balance-tooltip/index.ts: -------------------------------------------------------------------------------- 1 | import { LockedBalanceTooltip } from './locked-balance-tooltip'; 2 | 3 | export { LockedBalanceTooltip }; 4 | -------------------------------------------------------------------------------- /js/frontend/src/features/wallet/components/connected-wallet-button/index.ts: -------------------------------------------------------------------------------- 1 | import { ConnectedWalletButton } from './connected-wallet-button'; 2 | 3 | export { ConnectedWalletButton }; 4 | -------------------------------------------------------------------------------- /js/indexer/src/common/index.ts: -------------------------------------------------------------------------------- 1 | export * from './env.js'; 2 | export * from './nonce.js'; 3 | export * from './batch-state.js'; 4 | export * from './map.js'; 5 | export * from './hash.js'; 6 | -------------------------------------------------------------------------------- /js/indexer/src/gear/types/historical-proxy.ts: -------------------------------------------------------------------------------- 1 | export interface Relayed { 2 | readonly slot: string; 3 | readonly block_number: number; 4 | readonly transaction_index: number; 5 | } 6 | -------------------------------------------------------------------------------- /gear-programs/bridging-payment/client/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | 3 | // Incorporate code generated based on the IDL file 4 | include!(concat!(env!("OUT_DIR"), "/bridging_payment_client.rs")); 5 | -------------------------------------------------------------------------------- /gear-programs/eth-events-deneb/client/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | 3 | // Incorporate code generated based on the IDL file 4 | include!(concat!(env!("OUT_DIR"), "/eth_events_deneb_client.rs")); 5 | -------------------------------------------------------------------------------- /gear-programs/historical-proxy/client/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | 3 | // Incorporate code generated based on the IDL file 4 | include!(concat!(env!("OUT_DIR"), "/historical_proxy_client.rs")); 5 | -------------------------------------------------------------------------------- /js/frontend/src/features/swap/index.ts: -------------------------------------------------------------------------------- 1 | import { Swap, PayVaraFeeButton, RelayTxButton, RelayTxNote } from './components'; 2 | 3 | export { Swap, PayVaraFeeButton, RelayTxButton, RelayTxNote }; 4 | -------------------------------------------------------------------------------- /gear-programs/eth-events-deneb/app/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | 3 | use ethereum_common::beacon::light::Block as LightBeaconBlock; 4 | 5 | include!("../../../eth-events-common/src/lib-template.rs"); 6 | -------------------------------------------------------------------------------- /gear-programs/eth-events-electra/client/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | 3 | // Incorporate code generated based on the IDL file 4 | include!(concat!(env!("OUT_DIR"), "/eth_events_electra_client.rs")); 5 | -------------------------------------------------------------------------------- /gear-programs/vft-manager/app/src/services/submit_receipt/abi.rs: -------------------------------------------------------------------------------- 1 | alloy_sol_types::sol!( 2 | #[allow(missing_docs)] 3 | ERC20_MANAGER, 4 | "../../../api/ethereum/ERC20Manager.json" 5 | ); 6 | -------------------------------------------------------------------------------- /js/frontend/src/components/layout/truncated-text/truncated-text.module.scss: -------------------------------------------------------------------------------- 1 | .text { 2 | display: block; 3 | 4 | white-space: nowrap; 5 | overflow: hidden; 6 | text-overflow: ellipsis; 7 | } 8 | -------------------------------------------------------------------------------- /js/frontend/src/features/token-price/components/token-price/token-price.module.scss: -------------------------------------------------------------------------------- 1 | .price { 2 | margin-left: auto; 3 | 4 | font-size: 14px; 5 | line-height: 20px; 6 | color: #828b8e; 7 | } 8 | -------------------------------------------------------------------------------- /js/indexer/src/model/entities/_status.ts: -------------------------------------------------------------------------------- 1 | export enum Status { 2 | AwaitingPayment = 'AwaitingPayment', 3 | Bridging = 'Bridging', 4 | Completed = 'Completed', 5 | Failed = 'Failed', 6 | } 7 | -------------------------------------------------------------------------------- /tests/src/checkpoint_light_client/chain-data/holesky-update-368.json.zst: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gear-tech/gear-bridges/HEAD/tests/src/checkpoint_light_client/chain-data/holesky-update-368.json.zst -------------------------------------------------------------------------------- /gear-programs/eth-events-electra/app/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | use ethereum_common::beacon::light::electra::Block as LightBeaconBlock; 3 | 4 | include!("../../../eth-events-common/src/lib-template.rs"); 5 | -------------------------------------------------------------------------------- /js/bridge-js/.swcrc: -------------------------------------------------------------------------------- 1 | { 2 | "jsc": { 3 | "target": "es2020", 4 | "parser": { "syntax": "typescript" }, 5 | }, 6 | "sourceMaps": false, 7 | "module": { "type": "es6", "outDir": "lib" } 8 | } 9 | -------------------------------------------------------------------------------- /js/common/.swcrc: -------------------------------------------------------------------------------- 1 | { 2 | "jsc": { 3 | "target": "es2020", 4 | "parser": { "syntax": "typescript" }, 5 | }, 6 | "sourceMaps": false, 7 | "module": { "type": "es6", "outDir": "lib" } 8 | } 9 | -------------------------------------------------------------------------------- /js/frontend/src/components/layout/container/container.module.scss: -------------------------------------------------------------------------------- 1 | .container { 2 | width: 100%; 3 | max-width: 1200px; 4 | margin: 0 auto; 5 | padding: 0 16px; 6 | 7 | position: relative; 8 | } 9 | -------------------------------------------------------------------------------- /tests/src/checkpoint_light_client/chain-data/holesky-bootstrap-368.json.zst: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gear-tech/gear-bridges/HEAD/tests/src/checkpoint_light_client/chain-data/holesky-bootstrap-368.json.zst -------------------------------------------------------------------------------- /js/bridge-js/src/ethereum/index.ts: -------------------------------------------------------------------------------- 1 | export * from './ethereum-client.js'; 2 | export * from './beacon-client.js'; 3 | export * from './message-queue.js'; 4 | export { getSlotByBlockNumber } from './helpers.js'; 5 | -------------------------------------------------------------------------------- /js/frontend/src/features/history/components/pending-transactions-warning/index.ts: -------------------------------------------------------------------------------- 1 | import { PendingTransactionsWarning } from './pending-transactions-warning'; 2 | 3 | export { PendingTransactionsWarning }; 4 | -------------------------------------------------------------------------------- /js/frontend/src/features/history/components/transactions-counter/transactions-counter.module.scss: -------------------------------------------------------------------------------- 1 | .text { 2 | font-weight: 600; 3 | } 4 | 5 | .heading { 6 | font-size: 11px; 7 | color: #9cacb1; 8 | } 9 | -------------------------------------------------------------------------------- /js/frontend/src/features/swap/components/swap-form/index.ts: -------------------------------------------------------------------------------- 1 | import { SwapEthForm } from './swap-eth-form'; 2 | import { SwapVaraForm } from './swap-vara-form'; 3 | 4 | export { SwapEthForm, SwapVaraForm }; 5 | -------------------------------------------------------------------------------- /js/frontend/src/consts/sails/index.ts: -------------------------------------------------------------------------------- 1 | import { SailsProgram as VftProgram } from './vft'; 2 | import { SailsProgram as WrappedVaraProgram } from './vft-vara'; 3 | 4 | export { VftProgram, WrappedVaraProgram }; 5 | -------------------------------------------------------------------------------- /js/frontend/src/features/swap/components/relay-tx-button/index.ts: -------------------------------------------------------------------------------- 1 | import { RelayTxButton } from './relay-tx-button'; 2 | import { RelayTxNote } from './relay-tx-note'; 3 | 4 | export { RelayTxButton, RelayTxNote }; 5 | -------------------------------------------------------------------------------- /lerna.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "node_modules/lerna/schemas/lerna-schema.json", 3 | "version": "independent", 4 | "packages": ["js/frontend", "js/indexer", "js/bridge-js", "js/common"], 5 | "npmClient": "yarn" 6 | } 7 | -------------------------------------------------------------------------------- /js/indexer/src/gear/types/index.ts: -------------------------------------------------------------------------------- 1 | export * from './event.js'; 2 | export * from './vft-manager.js'; 3 | export * from './historical-proxy.js'; 4 | export * from './bridging-payment.js'; 5 | export * from './handler.js'; 6 | -------------------------------------------------------------------------------- /circuits/plonky2_ecdsa/src/curve/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod curve_adds; 2 | pub mod curve_msm; 3 | pub mod curve_multiplication; 4 | pub mod curve_summation; 5 | pub mod curve_types; 6 | pub mod ecdsa; 7 | pub mod glv; 8 | pub mod secp256k1; 9 | -------------------------------------------------------------------------------- /circuits/plonky2_ed25519/src/gadgets/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod curve; 2 | pub mod curve_fixed_base; 3 | pub mod curve_windowed_mul; 4 | pub mod curve_windowed_mul_mt; 5 | pub mod eddsa; 6 | pub mod nonnative; 7 | pub mod split_nonnative; 8 | -------------------------------------------------------------------------------- /gear-programs/checkpoint-light-client/client/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | 3 | // Incorporate code generated based on the IDL file 4 | include!(concat!( 5 | env!("OUT_DIR"), 6 | "/checkpoint_light_client_client.rs" 7 | )); 8 | -------------------------------------------------------------------------------- /js/frontend/src/features/history/components/transaction-date/transaction-date.module.scss: -------------------------------------------------------------------------------- 1 | .date { 2 | display: flex; 3 | align-items: center; 4 | gap: 4px; 5 | 6 | svg { 7 | flex-shrink: 0; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /js/frontend/src/features/token-tracker/components/index.ts: -------------------------------------------------------------------------------- 1 | import { LockedBalanceTooltip } from './locked-balance-tooltip'; 2 | import { TokensCard } from './tokens-card'; 3 | 4 | export { LockedBalanceTooltip, TokensCard }; 5 | -------------------------------------------------------------------------------- /js/frontend/src/features/token-tracker/hooks/index.ts: -------------------------------------------------------------------------------- 1 | import { useBurnEthTokens } from './use-burn-eth-tokens'; 2 | import { useBurnVaraTokens } from './use-burn-vara-tokens'; 3 | 4 | export { useBurnEthTokens, useBurnVaraTokens }; 5 | -------------------------------------------------------------------------------- /js/indexer/src/gear/types/bridging-payment.ts: -------------------------------------------------------------------------------- 1 | export interface BridgingPaidEvent { 2 | readonly nonce: string; 3 | } 4 | 5 | export interface PriorityBridgingPaid { 6 | readonly block: string; 7 | readonly nonce: string; 8 | } 9 | -------------------------------------------------------------------------------- /js/indexer/src/gear/handlers/index.ts: -------------------------------------------------------------------------------- 1 | export * from './bridging-payment.js'; 2 | export * from './historical-proxy.js'; 3 | export * from './vft-manager.js'; 4 | export * from './eth-bridge.js'; 5 | export * from './program-changed.js'; 6 | -------------------------------------------------------------------------------- /js/bridge-js/tsconfig.types.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "declaration": true, 5 | "emitDeclarationOnly": true, 6 | "outDir": "lib/types" 7 | }, 8 | "include": ["src"] 9 | } 10 | -------------------------------------------------------------------------------- /js/frontend/src/consts/routing.ts: -------------------------------------------------------------------------------- 1 | const ROUTE = { 2 | HOME: '/', 3 | TRANSACTIONS: '/transactions', 4 | TRANSACTION: '/transaction/:id', 5 | TOKEN_TRACKER: '/my-tokens', 6 | FAQ: '/faq', 7 | }; 8 | 9 | export { ROUTE }; 10 | -------------------------------------------------------------------------------- /js/frontend/src/features/history/types.ts: -------------------------------------------------------------------------------- 1 | import { Transfer, NetworkEnum, StatusEnum, TransferFilter } from './graphql/graphql'; 2 | 3 | export { NetworkEnum as Network, StatusEnum as Status }; 4 | export type { Transfer, TransferFilter }; 5 | -------------------------------------------------------------------------------- /utils-prometheus/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "utils-prometheus" 3 | version.workspace = true 4 | edition.workspace = true 5 | 6 | [dependencies] 7 | axum.workspace = true 8 | prometheus.workspace = true 9 | tokio.workspace = true 10 | -------------------------------------------------------------------------------- /js/frontend/src/features/wallet/components/connect-wallet-button/connect-wallet-button.module.scss: -------------------------------------------------------------------------------- 1 | .button { 2 | svg { 3 | width: 16px; 4 | height: 16px; 5 | 6 | border: 1px solid #777; 7 | border-radius: 50%; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /js/frontend/src/hooks/use-vara-symbol.ts: -------------------------------------------------------------------------------- 1 | import { useApi } from '@gear-js/react-hooks'; 2 | 3 | function useVaraSymbol() { 4 | const { api } = useApi(); 5 | 6 | return api?.registry.chainTokens[0]; 7 | } 8 | 9 | export { useVaraSymbol }; 10 | -------------------------------------------------------------------------------- /js/indexer/src/common/hash.ts: -------------------------------------------------------------------------------- 1 | import xxhash from 'xxhash-addon'; 2 | 3 | export const hash = (...args: (string | number | bigint)[]) => { 4 | const message = Buffer.from(args.join('')); 5 | return xxhash.XXHash3.hash(message).toString('hex'); 6 | }; 7 | -------------------------------------------------------------------------------- /tools/governance/deployment.example.mainnet.toml: -------------------------------------------------------------------------------- 1 | # https://wiki.vara.network/docs/bridge/developer_hub#ethereum-mainnet 2 | GovernanceAdmin = "0x3681A3e25F5652389B8f52504D517E96352830C3" 3 | GovernancePauser = "0x257936C55518609E47eAab53f40a6e19437BEF47" 4 | -------------------------------------------------------------------------------- /tools/governance/deployment.example.hoodi.toml: -------------------------------------------------------------------------------- 1 | # https://wiki.vara.network/docs/bridge/developer_hub#ethereum-testnet-hoodi 2 | GovernanceAdmin = "0x3288b744ADbC25f07b636718d72ec07F8C77E5E9" 3 | GovernancePauser = "0x384B68Fc08c59Df51694f7F6A24A112B8331eEb0" 4 | -------------------------------------------------------------------------------- /circuits/plonky2_ecdsa/src/gadgets/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod biguint; 2 | pub mod curve; 3 | pub mod curve_fixed_base; 4 | pub mod curve_msm; 5 | pub mod curve_windowed_mul; 6 | pub mod ecdsa; 7 | pub mod glv; 8 | pub mod nonnative; 9 | pub mod split_nonnative; 10 | -------------------------------------------------------------------------------- /gear-programs/vft/app/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "vft-app" 3 | version.workspace = true 4 | edition.workspace = true 5 | 6 | [dependencies] 7 | awesome-sails-services.workspace = true 8 | sails-rs.workspace = true 9 | vft-common.workspace = true 10 | -------------------------------------------------------------------------------- /js/frontend/src/components/layout/error-boundary/error-boundary.module.scss: -------------------------------------------------------------------------------- 1 | .heading { 2 | margin-bottom: 16px; 3 | 4 | font-size: 32px; 5 | } 6 | 7 | .error { 8 | margin-bottom: 64px; 9 | 10 | font-size: 16px; 11 | color: #535352; 12 | } 13 | -------------------------------------------------------------------------------- /js/frontend/src/features/swap/components/relay-tx-button/relay-tx-note.module.scss: -------------------------------------------------------------------------------- 1 | .text { 2 | text-align: right; 3 | font-size: 10px; 4 | color: #9cacb1; 5 | line-height: 1; 6 | 7 | @include md { 8 | text-align: center; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /js/indexer/src/common/nonce.ts: -------------------------------------------------------------------------------- 1 | import * as crypto from 'node:crypto'; 2 | 3 | export const ethNonce = (data: string) => crypto.createHash('sha256').update(data).digest('hex'); 4 | 5 | export const gearNonce = (data: bigint) => { 6 | return data.toString(); 7 | }; 8 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "trailingComma": "all", 4 | "endOfLine": "lf", 5 | "printWidth": 120, 6 | "semi": true, 7 | "bracketSpacing": true, 8 | "bracketSameLine": true, 9 | "arrowParens": "always", 10 | "tabWidth": 2 11 | } 12 | -------------------------------------------------------------------------------- /js/bridge-js/vitest.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | 3 | export default defineConfig({ 4 | test: { 5 | environment: 'node', 6 | include: ['test/**/*.test.ts'], 7 | globalSetup: ['./test/setup/setup.ts'], 8 | }, 9 | }); 10 | -------------------------------------------------------------------------------- /js/frontend/src/features/swap/consts/settings.ts: -------------------------------------------------------------------------------- 1 | const PRIORITY = { 2 | DEFAULT: 'default', 3 | HIGH: 'high', 4 | } as const; 5 | 6 | const CLAIM_TYPE = { 7 | MANUAL: 'manual', 8 | AUTO: 'auto', 9 | } as const; 10 | 11 | export { PRIORITY, CLAIM_TYPE }; 12 | -------------------------------------------------------------------------------- /ethereum/src/erc20/interfaces/ICircleToken.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 2 | pragma solidity ^0.8.30; 3 | 4 | interface ICircleToken { 5 | function configureMinter(address minter, uint256 minterAllowedAmount) external; 6 | } 7 | -------------------------------------------------------------------------------- /tools/genesis-config/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "genesis-config" 3 | version.workspace = true 4 | edition.workspace = true 5 | 6 | [dependencies] 7 | clap.workspace = true 8 | gear-rpc-client.workspace = true 9 | hex.workspace = true 10 | tokio.workspace = true 11 | -------------------------------------------------------------------------------- /js/frontend/src/components/form/types.ts: -------------------------------------------------------------------------------- 1 | import { InputProps as VaraInputProps } from '@gear-js/vara-ui'; 2 | 3 | type Props = Omit & { 4 | name: string; 5 | }; 6 | 7 | type InputProps = Props; 8 | 9 | export type { Props, InputProps }; 10 | -------------------------------------------------------------------------------- /js/frontend/src/features/swap/components/index.ts: -------------------------------------------------------------------------------- 1 | import { PayVaraFeeButton } from './pay-vara-fee-button'; 2 | import { RelayTxButton, RelayTxNote } from './relay-tx-button'; 3 | import { Swap } from './swap'; 4 | 5 | export { Swap, PayVaraFeeButton, RelayTxButton, RelayTxNote }; 6 | -------------------------------------------------------------------------------- /js/frontend/vite.config.ts: -------------------------------------------------------------------------------- 1 | import { viteConfigs } from '@gear-js/frontend-configs'; 2 | import { mergeConfig } from 'vite'; 3 | 4 | export default mergeConfig(viteConfigs.app, { 5 | css: { preprocessorOptions: { scss: { additionalData: '@use "@/utils/breakpoints" as *;' } } }, 6 | }); 7 | -------------------------------------------------------------------------------- /relayer/src/message_relayer/common/gear/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod block_listener; 2 | pub mod block_storage; 3 | pub mod checkpoints_extractor; 4 | pub mod merkle_proof_fetcher; 5 | pub mod message_data_extractor; 6 | pub mod message_paid_event_extractor; 7 | pub mod message_queued_event_extractor; 8 | -------------------------------------------------------------------------------- /js/frontend/src/assets/search.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /js/frontend/src/features/swap/assets/plus.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /js/indexer/src/common/map.ts: -------------------------------------------------------------------------------- 1 | export const mapValues = (map: Map): Array => Array.from(map.values()); 2 | 3 | export const mapKeys = (map: Map): Array => Array.from(map.keys()); 4 | 5 | export const setValues = (set: Set): Array => Array.from(set.values()); 6 | -------------------------------------------------------------------------------- /prover/src/common/poseidon_bn128/fr.rs: -------------------------------------------------------------------------------- 1 | use ff::PrimeField; 2 | 3 | #[derive(PrimeField)] 4 | #[PrimeFieldModulus = "21888242871839275222246405745257275088548364400416034343698204186575808495617"] 5 | #[PrimeFieldGenerator = "7"] 6 | #[PrimeFieldReprEndianness = "little"] 7 | pub struct Fr([u64; 4]); 8 | -------------------------------------------------------------------------------- /relayer/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod cli; 2 | pub mod common; 3 | pub mod ethereum_checkpoints; 4 | pub mod hex_utils; 5 | pub mod kill_switch; 6 | pub mod merkle_roots; 7 | pub mod message_relayer; 8 | pub mod proof_storage; 9 | pub mod prover_interface; 10 | pub mod queue_cleaner; 11 | pub mod server; 12 | -------------------------------------------------------------------------------- /js/bridge-js/src/vara/index.ts: -------------------------------------------------------------------------------- 1 | export * from './checkpoint-client.js'; 2 | export * from './historical-proxy.js'; 3 | export * from './historical-proxy-types.js'; 4 | export * from './eth-to-vara.js'; 5 | export * from './util.js'; 6 | export * from './gear-client.js'; 7 | export * from './eth-events.js'; 8 | -------------------------------------------------------------------------------- /js/frontend/src/components/layout/header/consts.ts: -------------------------------------------------------------------------------- 1 | import { ROUTE } from '@/consts'; 2 | 3 | const LINKS = { 4 | [ROUTE.HOME]: 'Bridge', 5 | [ROUTE.TRANSACTIONS]: 'Transactions', 6 | [ROUTE.TOKEN_TRACKER]: 'My Tokens', 7 | [ROUTE.FAQ]: 'FAQ', 8 | } as const; 9 | 10 | export { LINKS }; 11 | -------------------------------------------------------------------------------- /ethereum/src/erc20/interfaces/ITetherToken.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 2 | pragma solidity ^0.8.30; 3 | 4 | interface ITetherToken { 5 | function issue(uint256 amount) external; 6 | 7 | function approve(address spender, uint256 value) external; 8 | } 9 | -------------------------------------------------------------------------------- /gear-programs/vft-vara/app/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "vft-vara-app" 3 | version.workspace = true 4 | edition.workspace = true 5 | 6 | [dependencies] 7 | awesome-sails-services = { workspace = true, features = ["vft-native-exchange"] } 8 | sails-rs.workspace = true 9 | vft-common.workspace = true 10 | -------------------------------------------------------------------------------- /js/common/src/pair-hash.ts: -------------------------------------------------------------------------------- 1 | import { createHash } from 'node:crypto'; 2 | 3 | export const createPairHash = (sourceAddress: string, destinationAddress: string) => 4 | createHash('sha256') 5 | .update(sourceAddress + destinationAddress) 6 | .digest() 7 | .subarray(0, 16) 8 | .toString('hex'); 9 | -------------------------------------------------------------------------------- /api/README.md: -------------------------------------------------------------------------------- 1 | # Ethereum smart contracts ABI and gear programs idl files 2 | 3 | Contents of this folder are guaranteed to be up to date as there's a workflow in CI that checks that they match with ones generated when the project is built. 4 | 5 | > [!WARNING] 6 | > Update CI workflow when adding new files to this folder -------------------------------------------------------------------------------- /js/frontend/src/consts/index.ts: -------------------------------------------------------------------------------- 1 | import { ERC20_ABI, WRAPPED_ETH_ABI } from './abi'; 2 | import { GTM_ID } from './env'; 3 | import { ROUTE } from './routing'; 4 | import { VftProgram, WrappedVaraProgram } from './sails'; 5 | 6 | export { ERC20_ABI, WRAPPED_ETH_ABI, ROUTE, GTM_ID, VftProgram, WrappedVaraProgram }; 7 | -------------------------------------------------------------------------------- /js/frontend/src/context/network-type/eth-network-mismatch-modal.module.scss: -------------------------------------------------------------------------------- 1 | .modal { 2 | display: flex; 3 | flex-direction: column; 4 | gap: 32px; 5 | } 6 | 7 | .text { 8 | display: flex; 9 | flex-direction: column; 10 | gap: 4px; 11 | 12 | font-size: 12px; 13 | text-align: center; 14 | } 15 | -------------------------------------------------------------------------------- /js/frontend/src/context/network-type/types.ts: -------------------------------------------------------------------------------- 1 | import { NETWORK_PRESET, NETWORK_TYPE } from './consts'; 2 | 3 | type NetworkType = (typeof NETWORK_TYPE)[keyof typeof NETWORK_TYPE]; 4 | 5 | type NetworkPreset = (typeof NETWORK_PRESET)[keyof typeof NETWORK_PRESET]; 6 | 7 | export type { NetworkType, NetworkPreset }; 8 | -------------------------------------------------------------------------------- /js/bridge-js/ping/ping.idl: -------------------------------------------------------------------------------- 1 | constructor { 2 | New : (); 3 | }; 4 | 5 | service Ping { 6 | SubmitReceipt : (slot: u64, transaction_index: u32, _receipt_rlp: vec u8) -> result (null, str); 7 | 8 | events { 9 | ReceiptSubmitted: struct { 10 | u64, 11 | u32, 12 | }; 13 | } 14 | }; 15 | 16 | -------------------------------------------------------------------------------- /js/indexer/scripts/abi.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const path = require('path'); 3 | 4 | const [abiPath, destPath] = process.argv.slice(2); 5 | 6 | const abi = JSON.parse(fs.readFileSync(abiPath, 'utf8')); 7 | 8 | fs.writeFileSync(path.join(destPath, abiPath.split('/').at(-1)), JSON.stringify(abi.abi, null, 2)); 9 | -------------------------------------------------------------------------------- /gear-programs/eth-events-common/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "eth-events-common" 3 | version.workspace = true 4 | edition.workspace = true 5 | 6 | [dependencies] 7 | alloy-rlp.workspace = true 8 | checkpoint-light-client-client.workspace = true 9 | ethereum-common.workspace = true 10 | sails-rs.workspace = true 11 | -------------------------------------------------------------------------------- /js/frontend/src/features/swap/components/settings/tooltip-content.module.scss: -------------------------------------------------------------------------------- 1 | .bold { 2 | font-weight: 600; 3 | color: #fff; 4 | } 5 | 6 | .link { 7 | text-decoration: underline; 8 | color: #fff; 9 | } 10 | 11 | .list { 12 | margin-top: 4px; 13 | padding-left: 16px; 14 | 15 | list-style: disc; 16 | } 17 | -------------------------------------------------------------------------------- /mock-contract/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(feature = "std"), no_std)] 2 | 3 | #[cfg(feature = "std")] 4 | mod code { 5 | include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); 6 | } 7 | 8 | #[cfg(feature = "std")] 9 | pub use code::WASM_BINARY_OPT as WASM_BINARY; 10 | 11 | #[cfg(not(feature = "std"))] 12 | mod wasm; 13 | -------------------------------------------------------------------------------- /js/indexer/src/common/env.ts: -------------------------------------------------------------------------------- 1 | import * as dotenv from 'dotenv'; 2 | 3 | dotenv.config(); 4 | 5 | export const getEnv = (key: string, _default?: string): string => { 6 | const env = process.env[key] || _default; 7 | 8 | if (!env) { 9 | throw new Error(`Missing env: ${key}`); 10 | } 11 | 12 | return env; 13 | }; 14 | -------------------------------------------------------------------------------- /gear-programs/bridging-payment/app/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "bridging-payment-app" 3 | version.workspace = true 4 | edition.workspace = true 5 | 6 | [dependencies] 7 | sails-rs.workspace = true 8 | parity-scale-codec.workspace = true 9 | scale-info.workspace = true 10 | gstd.workspace = true 11 | zerocopy.workspace = true 12 | -------------------------------------------------------------------------------- /gear-programs/vft-common/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "vft-common" 3 | version.workspace = true 4 | edition.workspace = true 5 | 6 | [dependencies] 7 | awesome-sails.workspace = true 8 | awesome-sails-services = { workspace = true, features = ["vft-native-exchange"] } 9 | sails-rs.workspace = true 10 | zerocopy.workspace = true 11 | -------------------------------------------------------------------------------- /js/frontend/src/features/faq/assets/arrow.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /js/frontend/src/features/history/consts/icons.ts: -------------------------------------------------------------------------------- 1 | import EthSVG from '@/assets/eth.svg?react'; 2 | import VaraSVG from '@/assets/vara.svg?react'; 3 | 4 | import { Network } from '../types'; 5 | 6 | const NETWORK_SVG = { 7 | [Network.Vara]: VaraSVG, 8 | [Network.Ethereum]: EthSVG, 9 | } as const; 10 | 11 | export { NETWORK_SVG }; 12 | -------------------------------------------------------------------------------- /js/frontend/src/hooks/common/use-modal.ts: -------------------------------------------------------------------------------- 1 | import { useState } from 'react'; 2 | 3 | function useModal() { 4 | const [isOpen, setIsOpen] = useState(false); 5 | 6 | const open = () => setIsOpen(true); 7 | const close = () => setIsOpen(false); 8 | 9 | return [isOpen, open, close] as const; 10 | } 11 | 12 | export { useModal }; 13 | -------------------------------------------------------------------------------- /js/frontend/src/components/layout/index.ts: -------------------------------------------------------------------------------- 1 | import { Container } from './container'; 2 | import { ErrorBoundary } from './error-boundary'; 3 | import { Header } from './header'; 4 | import { Skeleton } from './skeleton'; 5 | import { TruncatedText } from './truncated-text'; 6 | 7 | export { Container, Header, ErrorBoundary, Skeleton, TruncatedText }; 8 | -------------------------------------------------------------------------------- /js/frontend/src/pages/token-tracker/token-tracker.module.scss: -------------------------------------------------------------------------------- 1 | .container { 2 | display: flex; 3 | justify-content: center; 4 | gap: 32px; 5 | 6 | @include md { 7 | flex-direction: column; 8 | align-items: center; 9 | gap: 16px; 10 | } 11 | 12 | > * { 13 | width: 100%; 14 | max-width: 490px; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /js/frontend/src/assets/wrapped-vara.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /gear-common/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "gear-common" 3 | version.workspace = true 4 | edition.workspace = true 5 | 6 | [dependencies] 7 | anyhow.workspace = true 8 | gclient.workspace = true 9 | log.workspace = true 10 | sails-rs = { workspace = true, features = ["gclient"] } 11 | vft-client.workspace = true 12 | vft-manager-client.workspace = true 13 | -------------------------------------------------------------------------------- /js/bridge-js/src/index.ts: -------------------------------------------------------------------------------- 1 | export { waitForMerkleRootAppearedInMessageQueue, getSlotByBlockNumber } from './ethereum/index.js'; 2 | export { decodeEthBridgeMessageResponse } from './vara/index.js'; 3 | export { relayEthToVara, type RelayEthToVaraParams } from './eth-to-vara/index.js'; 4 | export { relayVaraToEth, type RelayVaraToEthParams } from './vara-to-eth/index.js'; 5 | -------------------------------------------------------------------------------- /gear-programs/vft/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "vft" 3 | version.workspace = true 4 | edition.workspace = true 5 | 6 | [dependencies] 7 | vft-app.workspace = true 8 | 9 | [build-dependencies] 10 | vft-app.workspace = true 11 | sails-rs = { workspace = true, features = ["wasm-builder"] } 12 | sails-idl-gen.workspace = true 13 | 14 | [features] 15 | wasm-binary = [] 16 | -------------------------------------------------------------------------------- /js/frontend/src/components/form/index.ts: -------------------------------------------------------------------------------- 1 | import { Checkbox } from './checkbox'; 2 | import { Input } from './input'; 3 | import { Radio } from './radio'; 4 | import { Select } from './select'; 5 | import { Textarea } from './textarea'; 6 | import { InputProps } from './types'; 7 | 8 | export { Input, Checkbox, Radio, Select, Textarea }; 9 | export type { InputProps }; 10 | -------------------------------------------------------------------------------- /js/frontend/src/features/history/components/index.ts: -------------------------------------------------------------------------------- 1 | import { List } from './list'; 2 | import { PendingTransactionsWarning } from './pending-transactions-warning'; 3 | import { TransactionCard } from './transaction-card'; 4 | import { TransactionsCounter } from './transactions-counter'; 5 | 6 | export { List, TransactionCard, TransactionsCounter, PendingTransactionsWarning }; 7 | -------------------------------------------------------------------------------- /js/frontend/src/pages/not-found/not-found.module.scss: -------------------------------------------------------------------------------- 1 | .container { 2 | flex: 1; 3 | 4 | display: flex; 5 | flex-direction: column; 6 | align-items: center; 7 | justify-content: center; 8 | gap: 64px; 9 | 10 | font-size: 128px; 11 | line-height: 1.25; 12 | text-align: center; 13 | } 14 | 15 | .text { 16 | font-size: 24px; 17 | color: #f6f6f6; 18 | } 19 | -------------------------------------------------------------------------------- /relayer/build.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | go_bindings(); 3 | } 4 | 5 | fn go_bindings() { 6 | println!("cargo:rerun-if-changed=../gnark-wrapper/main.go"); 7 | 8 | cgo_oligami::Build::new() 9 | .build_mode(cgo_oligami::BuildMode::CArchive) 10 | .change_dir("./../gnark-wrapper") 11 | .package("main.go") 12 | .build("gnark_wrapper"); 13 | } 14 | -------------------------------------------------------------------------------- /relayer/src/message_relayer/common/ethereum/mod.rs: -------------------------------------------------------------------------------- 1 | use std::{cmp::Ordering, vec::Drain}; 2 | 3 | use super::{GearBlockNumber, RelayedMerkleRoot}; 4 | 5 | pub mod accumulator; 6 | pub mod block_listener; 7 | pub mod deposit_event_extractor; 8 | pub mod merkle_root_extractor; 9 | pub mod message_paid_event_extractor; 10 | pub mod message_sender; 11 | pub mod status_fetcher; 12 | -------------------------------------------------------------------------------- /ethereum-common/src/memory_db.rs: -------------------------------------------------------------------------------- 1 | use super::{keccak_hasher::KeccakHasher, *}; 2 | use ::memory_db::{HashKey, NoopTracker}; 3 | 4 | pub type MemoryDB = 5 | ::memory_db::MemoryDB, Vec, NoopTracker>>; 6 | 7 | pub fn new() -> MemoryDB { 8 | memory_db::MemoryDB::from_null_node(&rlp::NULL_RLP, rlp::NULL_RLP.as_ref().into()) 9 | } 10 | -------------------------------------------------------------------------------- /js/frontend/src/features/network-switch/assets/spinner.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /js/frontend/src/features/swap/consts/abi/index.ts: -------------------------------------------------------------------------------- 1 | import { BRIDGING_PAYMENT_ABI } from './bridging-payment-abi'; 2 | import { ERC20_MANAGER_ABI } from './erc20-manager-abi'; 3 | import { ERC20PERMIT_NONCES_ABI } from './erc20permit-nonces-abi'; 4 | import { ERC5267_ABI } from './erc5267-abi'; 5 | 6 | export { BRIDGING_PAYMENT_ABI, ERC20_MANAGER_ABI, ERC20PERMIT_NONCES_ABI, ERC5267_ABI }; 7 | -------------------------------------------------------------------------------- /js/frontend/src/hooks/use-vft-program.ts: -------------------------------------------------------------------------------- 1 | import { HexString } from '@gear-js/api'; 2 | import { useProgram } from '@gear-js/react-hooks'; 3 | 4 | import { VftProgram } from '@/consts'; 5 | 6 | function useVFTProgram(address: HexString | undefined) { 7 | return useProgram({ 8 | library: VftProgram, 9 | id: address, 10 | }); 11 | } 12 | 13 | export { useVFTProgram }; 14 | -------------------------------------------------------------------------------- /circuits/plonky2_ed25519/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![allow(clippy::needless_range_loop)] 2 | // Below lint is currently broken and produces false positives. 3 | // TODO: Remove this override when Clippy is patched. 4 | #![allow(clippy::derive_partial_eq_without_eq)] 5 | #![allow(incomplete_features)] 6 | #![feature(generic_const_exprs)] 7 | 8 | pub mod curve; 9 | pub mod field; 10 | pub mod gadgets; 11 | -------------------------------------------------------------------------------- /js/frontend/src/hooks/common/index.ts: -------------------------------------------------------------------------------- 1 | import { useChangeEffect } from './use-change-effect'; 2 | import { useDebounce } from './use-debounce'; 3 | import { useInvalidateOnBlock } from './use-invalidate-on-block'; 4 | import { useLoading } from './use-loading'; 5 | import { useModal } from './use-modal'; 6 | 7 | export { useModal, useLoading, useChangeEffect, useDebounce, useInvalidateOnBlock }; 8 | -------------------------------------------------------------------------------- /gear-programs/vft-vara/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "vft-vara" 3 | version.workspace = true 4 | edition.workspace = true 5 | 6 | [dependencies] 7 | vft-vara-app.workspace = true 8 | 9 | [build-dependencies] 10 | vft-vara-app.workspace = true 11 | sails-rs = { workspace = true, features = ["wasm-builder"] } 12 | sails-idl-gen.workspace = true 13 | 14 | [features] 15 | wasm-binary = [] 16 | -------------------------------------------------------------------------------- /js/frontend/src/hooks/common/use-loading.ts: -------------------------------------------------------------------------------- 1 | import { useState } from 'react'; 2 | 3 | function useLoading() { 4 | const [isLoading, setIsLoading] = useState(false); 5 | 6 | const enableLoading = () => setIsLoading(true); 7 | const disableLoading = () => setIsLoading(false); 8 | 9 | return [isLoading, enableLoading, disableLoading] as const; 10 | } 11 | 12 | export { useLoading }; 13 | -------------------------------------------------------------------------------- /js/frontend/src/features/swap/hooks/vara/use-init-archive-api.ts: -------------------------------------------------------------------------------- 1 | import { GearApi } from '@gear-js/api'; 2 | 3 | import { useNetworkType } from '@/context/network-type'; 4 | 5 | function useInitArchiveApi() { 6 | const { NETWORK_PRESET } = useNetworkType(); 7 | 8 | return () => GearApi.create({ providerAddress: NETWORK_PRESET.ARCHIVE_NODE_ADDRESS }); 9 | } 10 | 11 | export { useInitArchiveApi }; 12 | -------------------------------------------------------------------------------- /ethereum/src/interfaces/IERC20Mintable.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 2 | pragma solidity ^0.8.30; 3 | 4 | /** 5 | * @dev Extension of {ERC20} that allows token holders to mint tokens. 6 | */ 7 | interface IERC20Mintable { 8 | /** 9 | * @dev Mints `amount` tokens to `to`. 10 | */ 11 | function mint(address to, uint256 amount) external; 12 | } 13 | -------------------------------------------------------------------------------- /gear-programs/vft/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | 3 | #[cfg(target_arch = "wasm32")] 4 | pub use vft_app::wasm::*; 5 | 6 | #[cfg(feature = "wasm-binary")] 7 | #[cfg(not(target_arch = "wasm32"))] 8 | pub use code::WASM_BINARY_OPT as WASM_BINARY; 9 | 10 | #[cfg(feature = "wasm-binary")] 11 | #[cfg(not(target_arch = "wasm32"))] 12 | mod code { 13 | include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); 14 | } 15 | -------------------------------------------------------------------------------- /ethereum/script/Deployment.s.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 2 | pragma solidity ^0.8.30; 3 | 4 | import {Script} from "forge-std/Script.sol"; 5 | import {Base} from "test/Base.sol"; 6 | 7 | contract DeploymentScript is Script, Base { 8 | function setUp() public {} 9 | 10 | function run() public { 11 | deployBridgeFromEnvironment(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /js/frontend/src/features/wallet/components/connected-wallet-button/connected-wallet-button.module.scss: -------------------------------------------------------------------------------- 1 | .button { 2 | --padding: 4px 16px; 3 | 4 | @include lg { 5 | --padding: 4px; 6 | } 7 | 8 | @include md { 9 | display: none; 10 | } 11 | 12 | img { 13 | width: 24px; 14 | height: 24px; 15 | } 16 | } 17 | 18 | .address { 19 | @include lg { 20 | display: none; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /gear-programs/eth-events-deneb/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "eth-events-deneb" 3 | version.workspace = true 4 | edition.workspace = true 5 | 6 | [dependencies] 7 | eth-events-deneb-app.workspace = true 8 | 9 | [build-dependencies] 10 | eth-events-deneb-app.workspace = true 11 | sails-rs = { workspace = true, features = ["wasm-builder"] } 12 | sails-idl-gen.workspace = true 13 | 14 | [features] 15 | wasm-binary = [] 16 | -------------------------------------------------------------------------------- /gear-programs/vft-vara/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | 3 | #[cfg(target_arch = "wasm32")] 4 | pub use vft_vara_app::wasm::*; 5 | 6 | #[cfg(feature = "wasm-binary")] 7 | #[cfg(not(target_arch = "wasm32"))] 8 | pub use code::WASM_BINARY_OPT as WASM_BINARY; 9 | 10 | #[cfg(feature = "wasm-binary")] 11 | #[cfg(not(target_arch = "wasm32"))] 12 | mod code { 13 | include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); 14 | } 15 | -------------------------------------------------------------------------------- /js/frontend/src/components/form/radio/radio.tsx: -------------------------------------------------------------------------------- 1 | import { Radio as VaraRadio, RadioProps } from '@gear-js/vara-ui'; 2 | import { useFormContext } from 'react-hook-form'; 3 | 4 | import { Props } from '../types'; 5 | 6 | function Radio({ name, ...props }: Props) { 7 | const { register } = useFormContext(); 8 | 9 | return ; 10 | } 11 | 12 | export { Radio }; 13 | -------------------------------------------------------------------------------- /gear-programs/bridging-payment/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "bridging-payment" 3 | version.workspace = true 4 | edition.workspace = true 5 | 6 | [dependencies] 7 | bridging-payment-app = { path = "app" } 8 | 9 | [build-dependencies] 10 | bridging-payment-app = { path = "app" } 11 | sails-rs = { workspace = true, features = ["wasm-builder"] } 12 | sails-idl-gen.workspace = true 13 | 14 | [features] 15 | wasm-binary = [] 16 | -------------------------------------------------------------------------------- /gear-programs/vft-manager/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | 3 | #[cfg(target_arch = "wasm32")] 4 | pub use vft_manager_app::wasm::*; 5 | 6 | #[cfg(feature = "wasm-binary")] 7 | #[cfg(not(target_arch = "wasm32"))] 8 | pub use code::WASM_BINARY_OPT as WASM_BINARY; 9 | 10 | #[cfg(feature = "wasm-binary")] 11 | #[cfg(not(target_arch = "wasm32"))] 12 | mod code { 13 | include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); 14 | } 15 | -------------------------------------------------------------------------------- /js/common/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES2020", 4 | "module": "ESNext", 5 | "moduleResolution": "bundler", 6 | "outDir": "./lib", 7 | "esModuleInterop": true, 8 | "forceConsistentCasingInFileNames": true, 9 | "strict": true, 10 | "strictPropertyInitialization": false, 11 | "skipLibCheck": true, 12 | "noEmit": false 13 | }, 14 | "include": ["src"] 15 | } 16 | -------------------------------------------------------------------------------- /js/frontend/src/context/network-type/index.ts: -------------------------------------------------------------------------------- 1 | import { DEFAULT_NETWORK_TYPE, NETWORK_TYPE, NETWORK_PRESET, DEFAULT_NETWORK_PRESET } from './consts'; 2 | import { useNetworkType } from './context'; 3 | import { NetworkTypeProvider } from './provider'; 4 | 5 | export { 6 | NetworkTypeProvider, 7 | useNetworkType, 8 | NETWORK_PRESET, 9 | DEFAULT_NETWORK_TYPE, 10 | NETWORK_TYPE, 11 | DEFAULT_NETWORK_PRESET, 12 | }; 13 | -------------------------------------------------------------------------------- /tools/governance/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "governance-tool" 3 | version.workspace = true 4 | edition.workspace = true 5 | 6 | [dependencies] 7 | alloy.workspace = true 8 | clap.workspace = true 9 | gprimitives = { workspace = true, features = ["serde"] } 10 | hex = { workspace = true, features = ["std"] } 11 | serde.workspace = true 12 | thiserror.workspace = true 13 | tokio.workspace = true 14 | toml.workspace = true 15 | -------------------------------------------------------------------------------- /js/frontend/src/features/swap/consts/eth.ts: -------------------------------------------------------------------------------- 1 | const FUNCTION_NAME = { 2 | DEPOSIT: 'deposit', 3 | 4 | FUNGIBLE_TOKEN_BALANCE: 'balanceOf', // fungible token abi 5 | FUNGIBLE_TOKEN_APPROVE: 'approve', // fungible token abi 6 | FUNGIBLE_TOKEN_DECIMALS: 'decimals', // fungible token abi 7 | } as const; 8 | 9 | const EVENT_NAME = { 10 | APPROVAL: 'Approval', 11 | } as const; 12 | 13 | export { FUNCTION_NAME, EVENT_NAME }; 14 | -------------------------------------------------------------------------------- /gear-programs/bridging-payment/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | 3 | #[cfg(target_arch = "wasm32")] 4 | pub use bridging_payment_app::wasm::*; 5 | 6 | #[cfg(feature = "wasm-binary")] 7 | #[cfg(not(target_arch = "wasm32"))] 8 | pub use code::WASM_BINARY_OPT as WASM_BINARY; 9 | 10 | #[cfg(feature = "wasm-binary")] 11 | #[cfg(not(target_arch = "wasm32"))] 12 | mod code { 13 | include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); 14 | } 15 | -------------------------------------------------------------------------------- /gear-programs/eth-events-deneb/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | 3 | #[cfg(target_arch = "wasm32")] 4 | pub use eth_events_deneb_app::wasm::*; 5 | 6 | #[cfg(feature = "wasm-binary")] 7 | #[cfg(not(target_arch = "wasm32"))] 8 | pub use code::WASM_BINARY_OPT as WASM_BINARY; 9 | 10 | #[cfg(feature = "wasm-binary")] 11 | #[cfg(not(target_arch = "wasm32"))] 12 | mod code { 13 | include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); 14 | } 15 | -------------------------------------------------------------------------------- /gear-programs/historical-proxy/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | 3 | #[cfg(target_arch = "wasm32")] 4 | pub use historical_proxy_app::wasm::*; 5 | 6 | #[cfg(feature = "wasm-binary")] 7 | #[cfg(not(target_arch = "wasm32"))] 8 | pub use code::WASM_BINARY_OPT as WASM_BINARY; 9 | 10 | #[cfg(feature = "wasm-binary")] 11 | #[cfg(not(target_arch = "wasm32"))] 12 | mod code { 13 | include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); 14 | } 15 | -------------------------------------------------------------------------------- /js/frontend/src/assets/vara.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /js/frontend/src/features/history/consts/index.ts: -------------------------------------------------------------------------------- 1 | import { FIELD_NAME, DEFAULT_VALUES, TIMESTAMP_OPTIONS, STATUS_OPTIONS } from './filters'; 2 | import { NETWORK_SVG } from './icons'; 3 | import { TRANSACTIONS_LIMIT, TRANSFERS_QUERY } from './queries'; 4 | 5 | export { 6 | TRANSFERS_QUERY, 7 | TRANSACTIONS_LIMIT, 8 | FIELD_NAME, 9 | DEFAULT_VALUES, 10 | TIMESTAMP_OPTIONS, 11 | STATUS_OPTIONS, 12 | NETWORK_SVG, 13 | }; 14 | -------------------------------------------------------------------------------- /js/frontend/src/features/swap/hooks/eth/index.ts: -------------------------------------------------------------------------------- 1 | import { useEthFee } from './use-eth-fee'; 2 | import { useEthTxsEstimate } from './use-eth-txs-estimate'; 3 | import { useIsEthRelayAvailable } from './use-is-eth-relay-available'; 4 | import { useRelayEthTx } from './use-relay-eth-tx'; 5 | import { useSendEthTxs } from './use-send-eth-txs'; 6 | 7 | export { useEthFee, useRelayEthTx, useIsEthRelayAvailable, useSendEthTxs, useEthTxsEstimate }; 8 | -------------------------------------------------------------------------------- /gear-programs/eth-events-electra/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "eth-events-electra" 3 | version.workspace = true 4 | edition.workspace = true 5 | 6 | [dependencies] 7 | eth-events-electra-app.workspace = true 8 | 9 | [build-dependencies] 10 | eth-events-electra-app.workspace = true 11 | sails-rs = { workspace = true, features = ["wasm-builder"] } 12 | sails-idl-gen.workspace = true 13 | 14 | [features] 15 | wasm-binary = [] -------------------------------------------------------------------------------- /gear-programs/vft/client/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "vft-client" 3 | version.workspace = true 4 | edition.workspace = true 5 | 6 | [dependencies] 7 | mockall = { workspace = true, optional = true } 8 | sails-rs.workspace = true 9 | 10 | [build-dependencies] 11 | vft-app.workspace = true 12 | sails-client-gen.workspace = true 13 | sails-idl-gen.workspace = true 14 | 15 | [features] 16 | mocks = ["sails-rs/mockall", "dep:mockall"] 17 | -------------------------------------------------------------------------------- /js/bridge-js/src/vara-to-eth/util.ts: -------------------------------------------------------------------------------- 1 | import { u8aConcat, bnToU8a } from '@polkadot/util'; 2 | import { keccak256 } from 'viem'; 3 | 4 | import { VaraMessage } from '../vara/types.js'; 5 | 6 | export const messageHash = (msg: VaraMessage) => { 7 | const nonceBe = bnToU8a(msg.nonce, { bitLength: 256, isLe: false }); 8 | const bytes = u8aConcat(nonceBe, msg.source, msg.destination, msg.payload); 9 | return keccak256(bytes); 10 | }; 11 | -------------------------------------------------------------------------------- /js/frontend/src/features/network-switch/components/network-switch/network-switch.tsx: -------------------------------------------------------------------------------- 1 | import { useNetworkType } from '@/context/network-type'; 2 | 3 | import { Dropdown } from '../dropdown'; 4 | 5 | function NetworkSwitch() { 6 | const { networkType, isLoading, switchNetworks } = useNetworkType(); 7 | 8 | return ; 9 | } 10 | 11 | export { NetworkSwitch }; 12 | -------------------------------------------------------------------------------- /js/frontend/src/pages/index.tsx: -------------------------------------------------------------------------------- 1 | import { ConnectWallet } from './connect-wallet'; 2 | import { FAQ } from './faq'; 3 | import { Home } from './home'; 4 | import { NotFound } from './not-found'; 5 | import { TokenTracker } from './token-tracker'; 6 | import { Transaction } from './transaction'; 7 | import { Transactions } from './transactions'; 8 | 9 | export { NotFound, Home, Transactions, FAQ, TokenTracker, ConnectWallet, Transaction }; 10 | -------------------------------------------------------------------------------- /circuits/plonky2_blake2b256/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "plonky2_blake2b256" 3 | version.workspace = true 4 | edition.workspace = true 5 | 6 | [dependencies] 7 | anyhow.workspace = true 8 | plonky2.workspace = true 9 | plonky2_u32.workspace = true 10 | plonky2_util.workspace = true 11 | rand.workspace = true 12 | static_assertions.workspace = true 13 | 14 | [dev-dependencies] 15 | blake2.workspace = true 16 | plonky2_field.workspace = true 17 | -------------------------------------------------------------------------------- /gear-programs/vft-manager/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "vft-manager" 3 | version.workspace = true 4 | edition.workspace = true 5 | 6 | [dependencies] 7 | vft-manager-app = { path = "app" } 8 | 9 | [build-dependencies] 10 | vft-manager-app = { path = "app" } 11 | sails-rs = { workspace = true, features = ["wasm-builder"] } 12 | sails-idl-gen.workspace = true 13 | 14 | [features] 15 | wasm-binary = [] 16 | mocks = ["vft-manager-app/mocks"] 17 | -------------------------------------------------------------------------------- /js/frontend/src/components/form/checkbox/checkbox.tsx: -------------------------------------------------------------------------------- 1 | import { Checkbox as VaraCheckbox, CheckboxProps } from '@gear-js/vara-ui'; 2 | import { useFormContext } from 'react-hook-form'; 3 | 4 | import { Props } from '../types'; 5 | 6 | function Checkbox({ name, ...props }: Props) { 7 | const { register } = useFormContext(); 8 | 9 | return ; 10 | } 11 | 12 | export { Checkbox }; 13 | -------------------------------------------------------------------------------- /js/frontend/src/pages/token-tracker/token-tracker.tsx: -------------------------------------------------------------------------------- 1 | import { Container } from '@/components'; 2 | import { TokensCard } from '@/features/token-tracker'; 3 | 4 | import styles from './token-tracker.module.scss'; 5 | 6 | function TokenTracker() { 7 | return ( 8 | 9 | 10 | 11 | 12 | ); 13 | } 14 | 15 | export { TokenTracker }; 16 | -------------------------------------------------------------------------------- /ethereum/src/interfaces/IPausable.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 2 | pragma solidity ^0.8.30; 3 | 4 | /** 5 | * @dev Interface for the pausable contracts. 6 | */ 7 | interface IPausable { 8 | /** 9 | * @dev Pauses the contract. 10 | */ 11 | function pause() external; 12 | 13 | /** 14 | * @dev Unpauses the contract. 15 | */ 16 | function unpause() external; 17 | } 18 | -------------------------------------------------------------------------------- /ethereum/src/interfaces/IUUPSUpgradeable.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 2 | pragma solidity ^0.8.30; 3 | 4 | /** 5 | * @dev Interface for the UUPSUpgradeable contract. 6 | */ 7 | interface IUUPSUpgradeable { 8 | /** 9 | * @dev Upgrades the implementation of the contract. 10 | */ 11 | function upgradeToAndCall(address newImplementation, bytes calldata data) external payable; 12 | } 13 | -------------------------------------------------------------------------------- /gear-programs/checkpoint-light-client/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "checkpoint-light-client" 3 | version.workspace = true 4 | edition.workspace = true 5 | 6 | [dependencies] 7 | checkpoint-light-client-app.workspace = true 8 | 9 | [build-dependencies] 10 | checkpoint-light-client-app.workspace = true 11 | sails-rs = { workspace = true, features = ["wasm-builder"] } 12 | sails-idl-gen.workspace = true 13 | 14 | [features] 15 | wasm-binary = [] 16 | -------------------------------------------------------------------------------- /gear-programs/checkpoint-light-client/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | 3 | #[cfg(target_arch = "wasm32")] 4 | pub use checkpoint_light_client_app::wasm::*; 5 | 6 | #[cfg(feature = "wasm-binary")] 7 | #[cfg(not(target_arch = "wasm32"))] 8 | pub use code::WASM_BINARY_OPT as WASM_BINARY; 9 | 10 | #[cfg(feature = "wasm-binary")] 11 | #[cfg(not(target_arch = "wasm32"))] 12 | mod code { 13 | include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); 14 | } 15 | -------------------------------------------------------------------------------- /js/bridge-js/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES2020", 4 | "module": "ESNext", 5 | "moduleResolution": "bundler", 6 | "outDir": "./lib", 7 | "esModuleInterop": true, 8 | "forceConsistentCasingInFileNames": true, 9 | "strict": true, 10 | "strictPropertyInitialization": false, 11 | "skipLibCheck": true, 12 | "noEmit": false 13 | }, 14 | "include": ["src", "test", "example"] 15 | } 16 | -------------------------------------------------------------------------------- /js/frontend/src/components/form/select/select.tsx: -------------------------------------------------------------------------------- 1 | import { Select as VaraSelect, SelectProps } from '@gear-js/vara-ui'; 2 | import { useFormContext } from 'react-hook-form'; 3 | 4 | import { Props } from '../types'; 5 | 6 | function Select({ name, onChange, ...props }: Props) { 7 | const { register } = useFormContext(); 8 | 9 | return ; 10 | } 11 | 12 | export { Select }; 13 | -------------------------------------------------------------------------------- /js/indexer/src/model/entities/ethBridgeProgram.model.ts: -------------------------------------------------------------------------------- 1 | import { Entity, Column, PrimaryColumn, Index } from 'typeorm'; 2 | 3 | @Entity({ name: 'eth_bridge_program' }) 4 | export class EthBridgeProgram { 5 | constructor(props?: Partial) { 6 | Object.assign(this, props); 7 | } 8 | 9 | @PrimaryColumn() 10 | id!: string; 11 | 12 | @Index({ unique: true }) 13 | @Column({ nullable: false }) 14 | name!: string; 15 | } 16 | -------------------------------------------------------------------------------- /gear-programs/vft-vara/client/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "vft-vara-client" 3 | version.workspace = true 4 | edition.workspace = true 5 | 6 | [dependencies] 7 | mockall = { workspace = true, optional = true } 8 | sails-rs.workspace = true 9 | 10 | [build-dependencies] 11 | vft-vara-app.workspace = true 12 | sails-client-gen.workspace = true 13 | sails-idl-gen.workspace = true 14 | 15 | [features] 16 | mocks = ["sails-rs/mockall", "dep:mockall"] 17 | -------------------------------------------------------------------------------- /js/bridge-js/ping/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "ping" 3 | version.workspace = true 4 | edition.workspace = true 5 | 6 | [dependencies] 7 | sails-rs.workspace = true 8 | parity-scale-codec = { workspace = true, default-features = false, features = ["derive"] } 9 | scale-info = { workspace = true, default-features = false } 10 | zerocopy.workspace = true 11 | 12 | [build-dependencies] 13 | sails-rs = { workspace = true, features = ["wasm-builder"] } 14 | -------------------------------------------------------------------------------- /js/frontend/src/hooks/use-wrapped-vara-program.ts: -------------------------------------------------------------------------------- 1 | import { useProgram } from '@gear-js/react-hooks'; 2 | 3 | import { WrappedVaraProgram } from '@/consts'; 4 | import { useTokens } from '@/context'; 5 | 6 | function useWrappedVaraProgram() { 7 | const { nativeToken } = useTokens(); 8 | 9 | return useProgram({ 10 | library: WrappedVaraProgram, 11 | id: nativeToken.vara?.address, 12 | }); 13 | } 14 | 15 | export { useWrappedVaraProgram }; 16 | -------------------------------------------------------------------------------- /js/indexer/src/model/entities/varaBridgeProgram.model.ts: -------------------------------------------------------------------------------- 1 | import { Entity, Column, PrimaryColumn, Index } from 'typeorm'; 2 | 3 | @Entity({ name: 'vara_bridge_program' }) 4 | export class VaraBridgeProgram { 5 | constructor(props?: Partial) { 6 | Object.assign(this, props); 7 | } 8 | 9 | @PrimaryColumn() 10 | id!: string; 11 | 12 | @Index({ unique: true }) 13 | @Column({ nullable: false }) 14 | name!: string; 15 | } 16 | -------------------------------------------------------------------------------- /js/frontend/src/features/faq/assets/arrows-double.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /js/frontend/src/features/swap/consts/vara.ts: -------------------------------------------------------------------------------- 1 | const SERVICE_NAME = { 2 | BRIDGING_PAYMENT: 'bridgingPayment', 3 | VFT: 'vft', 4 | } as const; 5 | 6 | const FUNCTION_NAME = { 7 | APPROVE: 'approve', 8 | } as const; 9 | 10 | const QUERY_NAME = { 11 | FT_ADDRESSES: 'varaToEthAddresses', 12 | BALANCE: 'balanceOf', 13 | DECIMALS: 'decimals', 14 | GET_CONFIG: 'getConfig', 15 | } as const; 16 | 17 | export { SERVICE_NAME, FUNCTION_NAME, QUERY_NAME }; 18 | -------------------------------------------------------------------------------- /gear-programs/vft-manager/client/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "vft-manager-client" 3 | version.workspace = true 4 | edition.workspace = true 5 | 6 | [dependencies] 7 | mockall = { workspace = true, optional = true } 8 | sails-rs.workspace = true 9 | 10 | [build-dependencies] 11 | vft-manager-app = { path = "../app" } 12 | sails-client-gen.workspace = true 13 | sails-idl-gen.workspace = true 14 | 15 | [features] 16 | mocks = ["sails-rs/mockall", "dep:mockall"] 17 | -------------------------------------------------------------------------------- /js/frontend/src/features/history/assets/check.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /gear-programs/eth-events-electra/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | #![allow(unused_imports)] 3 | 4 | #[cfg(target_arch = "wasm32")] 5 | pub use eth_events_electra_app::wasm::*; 6 | 7 | #[cfg(feature = "wasm-binary")] 8 | #[cfg(not(target_arch = "wasm32"))] 9 | pub use code::WASM_BINARY_OPT as WASM_BINARY; 10 | 11 | #[cfg(feature = "wasm-binary")] 12 | #[cfg(not(target_arch = "wasm32"))] 13 | mod code { 14 | include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); 15 | } 16 | -------------------------------------------------------------------------------- /js/frontend/src/features/wallet/consts.ts: -------------------------------------------------------------------------------- 1 | import EnkryptSVG from './assets/enkrypt.svg?react'; 2 | import PolkadotSVG from './assets/polkadot.svg?react'; 3 | import SubWalletSVG from './assets/subwallet.svg?react'; 4 | import TalismanSVG from './assets/talisman.svg?react'; 5 | 6 | const WALLET_SVGS = { 7 | 'polkadot-js': PolkadotSVG, 8 | 'subwallet-js': SubWalletSVG, 9 | talisman: TalismanSVG, 10 | enkrypt: EnkryptSVG, 11 | }; 12 | 13 | export { WALLET_SVGS }; 14 | -------------------------------------------------------------------------------- /js/indexer/src/model/entities/index.ts: -------------------------------------------------------------------------------- 1 | export * from './transfer.model.js'; 2 | export * from './_network.js'; 3 | export * from './_status.js'; 4 | export * from './gearEthBridgeMessage.model.js'; 5 | export * from './initiatedTransfer.model.js'; 6 | export * from './pair.model.js'; 7 | export * from './completedTransfer.model.js'; 8 | export * from './varaBridgeProgram.model.js'; 9 | export * from './ethBridgeProgram.model.js'; 10 | export * from './merkleRoot.js'; 11 | -------------------------------------------------------------------------------- /gear-programs/vft/README.md: -------------------------------------------------------------------------------- 1 | ## The **vft** program 2 | 3 | The program workspace includes the following packages: 4 | - `vft` is the package allowing to build WASM binary for the program and IDL file for it. 5 | - `vft-app` is the package containing business logic for the program represented by the `VftService` structure. 6 | - `vft-client` is the package containing the client for the program allowing to interact with it from another program, tests, or 7 | off-chain client. 8 | 9 | -------------------------------------------------------------------------------- /js/frontend/src/features/swap/types/form.ts: -------------------------------------------------------------------------------- 1 | import { HexString } from '@gear-js/api'; 2 | 3 | import { DEFAULT_VALUES, FIELD_NAME, SUBMIT_STATUS } from '../consts'; 4 | 5 | type Values = typeof DEFAULT_VALUES; 6 | 7 | type FormattedValues = { 8 | [FIELD_NAME.VALUE]: bigint; 9 | [FIELD_NAME.ADDRESS]: HexString; 10 | }; 11 | 12 | type SubmitStatus = (typeof SUBMIT_STATUS)[keyof typeof SUBMIT_STATUS]; 13 | 14 | export type { Values, FormattedValues, SubmitStatus }; 15 | -------------------------------------------------------------------------------- /js/frontend/src/pages/home/home.tsx: -------------------------------------------------------------------------------- 1 | import { Container } from '@/components'; 2 | import { PendingTransactionsWarning } from '@/features/history'; 3 | import { Swap } from '@/features/swap'; 4 | 5 | import styles from './home.module.scss'; 6 | 7 | function Home() { 8 | return ( 9 | 10 | 11 | 12 | 13 | ); 14 | } 15 | 16 | export { Home }; 17 | -------------------------------------------------------------------------------- /gear-programs/bridging-payment/client/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "bridging-payment-client" 3 | version.workspace = true 4 | edition.workspace = true 5 | 6 | [dependencies] 7 | mockall = { workspace = true, optional = true } 8 | sails-rs.workspace = true 9 | 10 | [build-dependencies] 11 | bridging-payment-app = { path = "../app" } 12 | sails-client-gen.workspace = true 13 | sails-idl-gen.workspace = true 14 | 15 | [features] 16 | mocks = ["sails-rs/mockall", "dep:mockall"] 17 | -------------------------------------------------------------------------------- /gear-programs/proof-storage/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "gear_proof_storage" 3 | version.workspace = true 4 | edition.workspace = true 5 | 6 | [dependencies] 7 | gstd.workspace = true 8 | parity-scale-codec.workspace = true 9 | scale-info.workspace = true 10 | thiserror.workspace = true 11 | 12 | [build-dependencies] 13 | gear-wasm-builder.workspace = true 14 | 15 | [features] 16 | std = ["thiserror/std", "parity-scale-codec/std", "scale-info/std"] 17 | default = ["std"] 18 | -------------------------------------------------------------------------------- /js/frontend/src/components/tooltip/tooltip.module.scss: -------------------------------------------------------------------------------- 1 | .popup { 2 | padding: 10px 16px; 3 | 4 | font-size: 14px; 5 | line-height: 20px; 6 | color: #f6f6f6e5; 7 | 8 | background-color: #262628; 9 | border: 1px solid #ffffff0a; 10 | border-radius: 4px; 11 | 12 | transition: opacity 0.25s; 13 | 14 | &[data-starting-style], 15 | &[data-ending-style] { 16 | opacity: 0; 17 | } 18 | } 19 | 20 | .positioner { 21 | z-index: 11; // to be above modal 22 | } 23 | -------------------------------------------------------------------------------- /js/frontend/src/hooks/use-vara-account-balance.ts: -------------------------------------------------------------------------------- 1 | import { useAccount, useDeriveBalancesAll } from '@gear-js/react-hooks'; 2 | 3 | function useVaraAccountBalance() { 4 | const { account } = useAccount(); 5 | 6 | return useDeriveBalancesAll({ 7 | address: account?.address, 8 | watch: true, 9 | query: { 10 | select: (value) => (value.transferable || value.availableBalance).toBigInt(), 11 | }, 12 | }); 13 | } 14 | 15 | export { useVaraAccountBalance }; 16 | -------------------------------------------------------------------------------- /gear-programs/eth-events-deneb/app/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "eth-events-deneb-app" 3 | version.workspace = true 4 | edition.workspace = true 5 | 6 | [dependencies] 7 | eth-events-common.workspace = true 8 | ethereum-common.workspace = true 9 | sails-rs.workspace = true 10 | 11 | [target.'cfg(all(target_arch = "wasm32", target_os = "none"))'.dependencies] 12 | getrandom = { workspace = true, features = ["custom"] } 13 | lazy_static = { workspace = true, features = ["spin_no_std"] } 14 | -------------------------------------------------------------------------------- /gear-programs/historical-proxy/client/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "historical-proxy-client" 3 | version.workspace = true 4 | edition.workspace = true 5 | 6 | [dependencies] 7 | mockall = { workspace = true, optional = true } 8 | sails-rs.workspace = true 9 | 10 | [build-dependencies] 11 | historical-proxy-app = { path = "../app" } 12 | sails-client-gen.workspace = true 13 | sails-idl-gen.workspace = true 14 | 15 | 16 | [features] 17 | mocks = ["sails-rs/mockall", "dep:mockall"] 18 | -------------------------------------------------------------------------------- /js/indexer/src/eth/abi/bridging-payment.ts: -------------------------------------------------------------------------------- 1 | import * as ethers from 'ethers'; 2 | import * as fs from 'fs'; 3 | 4 | import { LogEvent } from './abi.support.js'; 5 | import { config } from '../config.js'; 6 | 7 | const ABI_JSON = JSON.parse(fs.readFileSync(`${config.apiPath}/IBridgingPayment.json`, 'utf-8')); 8 | 9 | export const abi = new ethers.Interface(ABI_JSON.abi); 10 | 11 | export const events = { 12 | FeePaid: new LogEvent<[]>(abi, abi.getEvent('FeePaid')!.topicHash), 13 | }; 14 | -------------------------------------------------------------------------------- /gear-programs/eth-events-electra/app/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "eth-events-electra-app" 3 | version.workspace = true 4 | edition.workspace = true 5 | 6 | [dependencies] 7 | eth-events-common.workspace = true 8 | ethereum-common.workspace = true 9 | sails-rs.workspace = true 10 | 11 | [target.'cfg(all(target_arch = "wasm32", target_os = "none"))'.dependencies] 12 | getrandom = { workspace = true, features = ["custom"] } 13 | lazy_static = { workspace = true, features = ["spin_no_std"] } 14 | -------------------------------------------------------------------------------- /js/bridge-js/js-test/contracts/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = "src" 3 | out = "out" 4 | test = "test" 5 | evm_version = "prague" 6 | solc = "0.8.30" 7 | optimizer = true 8 | optimizer_runs = 200 9 | via_ir = true 10 | libs = ["../../../../ethereum/lib"] 11 | remappings = ["forge-std=../../../../ethereum/lib/forge-std/src/", "ethereum=../../../../ethereum"] 12 | 13 | [rpc_endpoints] 14 | hoodi = "${HOODI_RPC_URL}" 15 | 16 | [etherscan] 17 | hoodi = { key = "${ETHERSCAN_API_KEY}" } 18 | -------------------------------------------------------------------------------- /js/bridge-js/js-test/contracts/src/MessageHandler.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 2 | pragma solidity ^0.8.30; 3 | 4 | import "ethereum/src/interfaces/IMessageHandler.sol"; 5 | 6 | contract MessageHandler is IMessageHandler { 7 | event MessageHandled(bytes32 indexed source, bytes payload); 8 | 9 | function handleMessage(bytes32 source, bytes calldata payload) external { 10 | emit MessageHandled(source, payload); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ethereum/src/interfaces/IVerifierMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 2 | pragma solidity ^0.8.30; 3 | 4 | import {IVerifier} from "./IVerifier.sol"; 5 | 6 | /** 7 | * @dev Interface for the VerifierMock contract. 8 | */ 9 | interface IVerifierMock is IVerifier { 10 | /** 11 | * @dev Sets the value. 12 | * @param value value to return from `safeVerifyProof` function. 13 | */ 14 | function setValue(bool value) external; 15 | } 16 | -------------------------------------------------------------------------------- /circuits/plonky2_u32/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "plonky2_u32" 3 | description = "u32 gadget for Plonky2" 4 | version = "0.1.0" 5 | license = "MIT OR Apache-2.0" 6 | repository = "https://github.com/mir-protocol/plonky2" 7 | edition = "2021" 8 | 9 | [dependencies] 10 | anyhow.workspace = true 11 | itertools.workspace = true 12 | num.workspace = true 13 | plonky2.workspace = true 14 | 15 | [dev-dependencies] 16 | plonky2 = { workspace = true, features = ["gate_testing"] } 17 | rand.workspace = true 18 | -------------------------------------------------------------------------------- /gear-programs/vft-vara/README.md: -------------------------------------------------------------------------------- 1 | ## The **vft-vara** program 2 | 3 | The program workspace includes the following packages: 4 | - `vft-vara` is the package allowing to build WASM binary for the program and IDL file for it. 5 | - `vft-vara-app` is the package containing business logic for the program represented by the `VftVaraService` structure. 6 | - `vft-vara-client` is the package containing the client for the program allowing to interact with it from another program, tests, or 7 | off-chain client. 8 | 9 | -------------------------------------------------------------------------------- /js/frontend/src/utils/_breakpoints.scss: -------------------------------------------------------------------------------- 1 | @mixin sm { 2 | @media (max-width: 640px) { 3 | @content; 4 | } 5 | } 6 | 7 | @mixin md { 8 | @media (max-width: 768px) { 9 | @content; 10 | } 11 | } 12 | 13 | @mixin lg { 14 | @media (max-width: 1024px) { 15 | @content; 16 | } 17 | } 18 | 19 | @mixin xl { 20 | @media (max-width: 1280px) { 21 | @content; 22 | } 23 | } 24 | 25 | @mixin breakpoint($breakpoint) { 26 | @media (max-width: $breakpoint) { 27 | @content; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /gear-programs/eth-events-deneb/client/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "eth-events-deneb-client" 3 | version.workspace = true 4 | edition.workspace = true 5 | 6 | [dependencies] 7 | ethereum-common.workspace = true 8 | mockall = { workspace = true, optional = true } 9 | sails-rs.workspace = true 10 | 11 | [build-dependencies] 12 | eth-events-deneb-app.workspace = true 13 | sails-client-gen.workspace = true 14 | sails-idl-gen.workspace = true 15 | 16 | [features] 17 | mocks = ["sails-rs/mockall", "dep:mockall"] 18 | -------------------------------------------------------------------------------- /js/frontend/src/features/network-switch/assets/world.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /gear-programs/eth-events-electra/client/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "eth-events-electra-client" 3 | version.workspace = true 4 | edition.workspace = true 5 | 6 | [dependencies] 7 | ethereum-common.workspace = true 8 | mockall = { workspace = true, optional = true } 9 | sails-rs.workspace = true 10 | 11 | [build-dependencies] 12 | eth-events-electra-app.workspace = true 13 | sails-client-gen.workspace = true 14 | sails-idl-gen.workspace = true 15 | 16 | [features] 17 | mocks = ["sails-rs/mockall", "dep:mockall"] 18 | -------------------------------------------------------------------------------- /js/frontend/src/components/layout/truncated-text/truncated-text.tsx: -------------------------------------------------------------------------------- 1 | import { cx } from '@/utils'; 2 | 3 | import styles from './truncated-text.module.scss'; 4 | 5 | type Props = { 6 | value: string; 7 | className?: string; 8 | }; 9 | 10 | function TruncatedText({ value, className, ...props }: Props) { 11 | return ( 12 | // spreading props for tooltip to work 13 | 14 | {value} 15 | 16 | ); 17 | } 18 | 19 | export { TruncatedText }; 20 | -------------------------------------------------------------------------------- /js/frontend/src/features/swap/components/swap/swap.tsx: -------------------------------------------------------------------------------- 1 | import { BridgeProvider, useBridgeContext } from '../../context'; 2 | import { SwapEthForm, SwapVaraForm } from '../swap-form'; 3 | 4 | function Component() { 5 | const { network } = useBridgeContext(); 6 | const Form = network.isVara ? SwapVaraForm : SwapEthForm; 7 | 8 | return
; 9 | } 10 | 11 | function Swap() { 12 | return ( 13 | 14 | 15 | 16 | ); 17 | } 18 | 19 | export { Swap }; 20 | -------------------------------------------------------------------------------- /js/frontend/src/features/swap/hooks/vara/use-vft-manager-program.ts: -------------------------------------------------------------------------------- 1 | import { useProgram } from '@gear-js/react-hooks'; 2 | 3 | import { useNetworkType } from '@/context/network-type'; 4 | 5 | import { VftManagerProgram } from '../../consts'; 6 | 7 | function useVFTManagerProgram() { 8 | const { NETWORK_PRESET } = useNetworkType(); 9 | 10 | return useProgram({ 11 | library: VftManagerProgram, 12 | id: NETWORK_PRESET.VFT_MANAGER_CONTRACT_ADDRESS, 13 | }); 14 | } 15 | 16 | export { useVFTManagerProgram }; 17 | -------------------------------------------------------------------------------- /ethereum-common/src/beacon/mod.rs: -------------------------------------------------------------------------------- 1 | use super::*; 2 | 3 | mod block; 4 | mod block_body; 5 | mod block_header; 6 | mod common; 7 | mod execution_payload; 8 | pub mod light; 9 | 10 | pub use block::Block; 11 | pub use block_body::BlockBody; 12 | pub use block_header::BlockHeader; 13 | pub use common::*; 14 | pub use execution_payload::ExecutionPayload; 15 | 16 | pub mod electra { 17 | pub use super::{block::electra::Block, block_body::electra::BlockBody, common::electra::*}; 18 | } 19 | 20 | #[cfg(test)] 21 | mod tests; 22 | -------------------------------------------------------------------------------- /js/bridge-js/src/ethereum/helpers.ts: -------------------------------------------------------------------------------- 1 | import { PublicClient } from 'viem'; 2 | 3 | import { createBeaconClient } from './beacon-client.js'; 4 | import { createEthereumClient } from './ethereum-client.js'; 5 | 6 | export async function getSlotByBlockNumber(beaconChainUrl: string, publicClient: PublicClient, blockNumber: bigint) { 7 | const beaconClient = await createBeaconClient(beaconChainUrl); 8 | const ethClient = createEthereumClient(publicClient, beaconClient); 9 | 10 | return ethClient.getSlot(blockNumber); 11 | } 12 | -------------------------------------------------------------------------------- /js/frontend/src/features/swap/hooks/vara/use-prepare-mint.ts: -------------------------------------------------------------------------------- 1 | import { usePrepareProgramTransaction } from '@gear-js/react-hooks'; 2 | 3 | import { useWrappedVaraProgram } from '@/hooks'; 4 | 5 | function usePrepareMint() { 6 | const { data: program } = useWrappedVaraProgram(); 7 | 8 | return { 9 | program, 10 | 11 | ...usePrepareProgramTransaction({ 12 | program, 13 | serviceName: 'vftNativeExchange', 14 | functionName: 'mint', 15 | }), 16 | }; 17 | } 18 | 19 | export { usePrepareMint }; 20 | -------------------------------------------------------------------------------- /ethereum-common/src/base_types/mod.rs: -------------------------------------------------------------------------------- 1 | //! The module contains implementations of basic types used by higher level 2 | //! types. Inspired by and . 3 | 4 | use super::*; 5 | 6 | mod bits; 7 | mod byte_list; 8 | mod bytes_fixed; 9 | mod fixed_array; 10 | mod list; 11 | 12 | pub use bits::{List as Bitlist, Vector as Bitvector}; 13 | pub use byte_list::ByteList; 14 | pub use bytes_fixed::BytesFixed; 15 | pub use fixed_array::FixedArray; 16 | pub use list::List; 17 | -------------------------------------------------------------------------------- /js/frontend/src/features/swap/types/index.ts: -------------------------------------------------------------------------------- 1 | import { SubmittableExtrinsic } from '@polkadot/api/types'; 2 | import { ISubmittableResult } from '@polkadot/types/types'; 3 | 4 | import { Values, FormattedValues } from './form'; 5 | import { UseAccountBalance, UseFTBalance, UseFee, UseSendTxs, UseTxsEstimate } from './hooks'; 6 | 7 | type Extrinsic = SubmittableExtrinsic<'promise', ISubmittableResult>; 8 | 9 | export type { UseAccountBalance, UseFTBalance, UseFee, UseSendTxs, UseTxsEstimate, Values, FormattedValues, Extrinsic }; 10 | -------------------------------------------------------------------------------- /js/frontend/src/types/index.ts: -------------------------------------------------------------------------------- 1 | import { HexString } from '@gear-js/api'; 2 | import { FunctionComponent, SVGProps } from 'react'; 3 | 4 | type SVGComponent = FunctionComponent< 5 | SVGProps & { 6 | title?: string | undefined; 7 | } 8 | >; 9 | 10 | type PropsWithClassName = { 11 | className?: string; 12 | }; 13 | 14 | type VaraAddress = HexString; 15 | type EthAddress = HexString; 16 | type FTAddressPair = [VaraAddress, EthAddress]; 17 | 18 | export type { SVGComponent, PropsWithClassName, FTAddressPair }; 19 | -------------------------------------------------------------------------------- /Dockerfile.dockerignore: -------------------------------------------------------------------------------- 1 | # Rust build directory 2 | target 3 | 4 | # Resource files 5 | audits 6 | images 7 | LICENSE 8 | *.md 9 | api 10 | 11 | # Git 12 | .git 13 | .gitignore 14 | .github 15 | 16 | # IDE-generated files 17 | .vscode 18 | .idea 19 | 20 | # Relayer config and intermediate data 21 | data 22 | proof_storage 23 | onchain_proof_storage_data 24 | .env 25 | 26 | # Ethereum-related 27 | ethereum/cache 28 | ethereum/out 29 | ethereum/broadcast 30 | 31 | # Indexer-related 32 | indexer/ 33 | 34 | # Frontend 35 | frontend/ 36 | -------------------------------------------------------------------------------- /js/indexer/src/model/entities/initiatedTransfer.model.ts: -------------------------------------------------------------------------------- 1 | import { Entity, Column, PrimaryColumn } from 'typeorm'; 2 | 3 | @Entity({ name: 'initiated_transfer' }) 4 | export class InitiatedTransfer { 5 | constructor(props?: Partial) { 6 | Object.assign(this, props); 7 | } 8 | 9 | @PrimaryColumn() 10 | id!: string; 11 | 12 | @Column({ nullable: false, name: 'tx_hash' }) 13 | txHash!: string; 14 | 15 | @Column('bigint', { nullable: false, name: 'block_number' }) 16 | blockNumber!: bigint; 17 | } 18 | -------------------------------------------------------------------------------- /gear-programs/eth-events-electra/README.md: -------------------------------------------------------------------------------- 1 | ## The **eth-events-electra** program 2 | 3 | The program workspace includes the following packages: 4 | - `eth-events-electra` is the package allowing to build WASM binary for the program and IDL file for it. 5 | - `eth-events-electra-app` is the package containing business logic for the program represented by the `Service` structure. 6 | - `eth-events-electra-client` is the package containing the client for the program allowing to interact with it from another program, tests, or 7 | off-chain client. 8 | -------------------------------------------------------------------------------- /js/frontend/src/hooks/common/use-invalidate-on-block.ts: -------------------------------------------------------------------------------- 1 | import { QueryKey, useQueryClient } from '@tanstack/react-query'; 2 | import { useWatchBlockNumber } from 'wagmi'; 3 | 4 | function useInvalidateOnBlock({ queryKey, enabled }: { queryKey: QueryKey; enabled?: boolean }) { 5 | const queryClient = useQueryClient(); 6 | 7 | const onBlockNumber = () => void queryClient.invalidateQueries({ queryKey }, { cancelRefetch: false }); 8 | 9 | useWatchBlockNumber({ enabled, onBlockNumber }); 10 | } 11 | 12 | export { useInvalidateOnBlock }; 13 | -------------------------------------------------------------------------------- /gear-programs/bridging-payment/README.md: -------------------------------------------------------------------------------- 1 | ## The **bridging-payment** program 2 | 3 | The program workspace includes the following packages: 4 | - `bridging-payment` is the package allowing to build WASM binary for the program and IDL file for it. 5 | - `bridging-payment-app` is the package containing business logic for the program represented by the `BridgingPaymentService` structure. 6 | - `bridging-payment-client` is the package containing the client for the program allowing to interact with it from another program, tests, or 7 | off-chain client. 8 | -------------------------------------------------------------------------------- /js/frontend/src/app.tsx: -------------------------------------------------------------------------------- 1 | import { Outlet, ScrollRestoration } from 'react-router-dom'; 2 | 3 | import { ErrorBoundary, Header } from './components'; 4 | import { WithProviders } from './providers'; 5 | 6 | function Component() { 7 | return ( 8 | <> 9 |
10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | ); 20 | } 21 | 22 | const App = WithProviders(Component); 23 | 24 | export { App }; 25 | -------------------------------------------------------------------------------- /js/frontend/src/features/history/hooks/use-accounts-filter.ts: -------------------------------------------------------------------------------- 1 | import { useAccount } from '@gear-js/react-hooks'; 2 | 3 | import { useEthAccount } from '@/hooks'; 4 | 5 | function useAccountsFilter() { 6 | const { account } = useAccount(); 7 | const ethAccount = useEthAccount(); 8 | 9 | const addresses = [account?.decodedAddress, ethAccount.address?.toLowerCase()].filter((value) => Boolean(value)); 10 | const isAvailable = addresses.length > 0; 11 | 12 | return { addresses, isAvailable }; 13 | } 14 | 15 | export { useAccountsFilter }; 16 | -------------------------------------------------------------------------------- /js/frontend/src/features/swap/consts/sails/index.ts: -------------------------------------------------------------------------------- 1 | import { SailsProgram as BridgingPaymentProgram } from './bridging-payment'; 2 | import { SailsProgram as CheckpointClientProgram } from './checkpoint-client'; 3 | import { SailsProgram as EthEventsProgram } from './eth-events'; 4 | import { SailsProgram as HistoricalProxyProgram } from './historical-proxy'; 5 | import { SailsProgram as VftManagerProgram } from './vft-manager'; 6 | 7 | export { BridgingPaymentProgram, VftManagerProgram, HistoricalProxyProgram, EthEventsProgram, CheckpointClientProgram }; 8 | -------------------------------------------------------------------------------- /js/frontend/src/pages/transaction/field.tsx: -------------------------------------------------------------------------------- 1 | import { PropsWithChildren } from 'react'; 2 | 3 | import { Card } from '@/components'; 4 | 5 | import styles from './transaction.module.scss'; 6 | 7 | type Props = PropsWithChildren & { 8 | label: string; 9 | }; 10 | 11 | function Field({ label, children }: Props) { 12 | return ( 13 |
14 | {label}: 15 | {children} 16 |
17 | ); 18 | } 19 | 20 | export { Field }; 21 | -------------------------------------------------------------------------------- /gear-programs/eth-events-deneb/README.md: -------------------------------------------------------------------------------- 1 | ## The **eth-events-deneb** program 2 | 3 | The program workspace includes the following packages: 4 | - `eth-events-deneb` is the package allowing to build WASM binary for the program and IDL file for it. 5 | - `eth-events-deneb-app` is the package containing business logic for the program represented by the `EthEventsDenebService` structure. 6 | - `eth-events-deneb-client` is the package containing the client for the program allowing to interact with it from another program, tests, or 7 | off-chain client. 8 | 9 | -------------------------------------------------------------------------------- /js/frontend/src/features/swap/components/settings/settings.module.scss: -------------------------------------------------------------------------------- 1 | .settings { 2 | padding: 20px 24px; 3 | 4 | display: flex; 5 | flex-direction: column; 6 | gap: 20px; 7 | 8 | background-color: #0e1217; 9 | border-radius: 12px; 10 | } 11 | 12 | .heading { 13 | font-weight: 600; 14 | color: #f6f6f6cc; 15 | } 16 | 17 | .body { 18 | display: grid; 19 | grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); 20 | gap: 20px; 21 | 22 | @include sm { 23 | display: flex; 24 | flex-direction: column; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /js/frontend/src/features/swap/hooks/vara/use-historical-proxy-contract-address.ts: -------------------------------------------------------------------------------- 1 | import { useProgramQuery } from '@gear-js/react-hooks'; 2 | 3 | import { useVFTManagerProgram } from './use-vft-manager-program'; 4 | 5 | function useHistoricalProxyContractAddress() { 6 | const { data: program } = useVFTManagerProgram(); 7 | 8 | return useProgramQuery({ 9 | program, 10 | serviceName: 'vftManager', 11 | functionName: 'historicalProxyAddress', 12 | args: [], 13 | }); 14 | } 15 | 16 | export { useHistoricalProxyContractAddress }; 17 | -------------------------------------------------------------------------------- /js/frontend/src/pages/not-found/not-found.tsx: -------------------------------------------------------------------------------- 1 | import { Container, LinkButton } from '@/components'; 2 | import { ROUTE } from '@/consts'; 3 | 4 | import styles from './not-found.module.scss'; 5 | 6 | function NotFound() { 7 | return ( 8 | 9 |
10 |

404

11 |

Page not found

12 |
13 | 14 | 15 |
16 | ); 17 | } 18 | 19 | export { NotFound }; 20 | -------------------------------------------------------------------------------- /ethereum/client/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "ethereum-client" 3 | version.workspace = true 4 | edition.workspace = true 5 | 6 | [dependencies] 7 | ahash.workspace = true 8 | alloy.workspace = true 9 | anyhow.workspace = true 10 | keccak-hash.workspace = true 11 | log.workspace = true 12 | primitive-types.workspace = true 13 | reqwest.workspace = true 14 | serde.workspace = true 15 | serde_json.workspace = true 16 | sp-core = { workspace = true, features = ["std"] } 17 | thiserror = { workspace = true, features = ["std"] } 18 | tokio.workspace = true 19 | -------------------------------------------------------------------------------- /gear-programs/checkpoint-light-client/io/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "checkpoint-light-client-io" 3 | version.workspace = true 4 | edition.workspace = true 5 | 6 | [dependencies] 7 | ark-bls12-381 = { workspace = true, features = ["curve"] } 8 | ark-scale.workspace = true 9 | ark-serialize.workspace = true 10 | ethereum-common.workspace = true 11 | sails-rs.workspace = true 12 | 13 | [features] 14 | default = ["std"] 15 | std = [ 16 | "ark-bls12-381/std", 17 | "ark-scale/std", 18 | "ark-serialize/std", 19 | "ethereum-common/std", 20 | ] 21 | -------------------------------------------------------------------------------- /js/common/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "gear-bridge-common", 3 | "private": true, 4 | "version": "0.1.0", 5 | "files": [ 6 | "lib" 7 | ], 8 | "type": "module", 9 | "module": "./lib/index.js", 10 | "types": "./src/index.ts", 11 | "exports": { 12 | ".": { 13 | "import": "./lib/index.js", 14 | "types": "./src/index.ts" 15 | } 16 | }, 17 | "scripts": { 18 | "clean": "npx rimraf lib", 19 | "build": "yarn clean && yarn build:esm", 20 | "build:esm": "npx swc ./src -d lib --strip-leading-paths" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /js/frontend/src/components/layout/container/container.tsx: -------------------------------------------------------------------------------- 1 | import { ReactNode } from 'react'; 2 | 3 | import { cx } from '@/utils'; 4 | 5 | import styles from './container.module.scss'; 6 | 7 | type Props = { 8 | children: ReactNode; 9 | maxWidth?: `${string}px`; 10 | className?: string; 11 | }; 12 | 13 | function Container({ children, maxWidth, className }: Props) { 14 | return ( 15 |
16 | {children} 17 |
18 | ); 19 | } 20 | 21 | export { Container }; 22 | -------------------------------------------------------------------------------- /js/frontend/src/features/network-switch/assets/arrow.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /js/frontend/src/features/swap/consts/abi/erc20permit-nonces-abi.ts: -------------------------------------------------------------------------------- 1 | const ERC20PERMIT_NONCES_ABI = [ 2 | { 3 | inputs: [ 4 | { 5 | internalType: 'address', 6 | name: 'owner', 7 | type: 'address', 8 | }, 9 | ], 10 | name: 'nonces', 11 | outputs: [ 12 | { 13 | internalType: 'uint256', 14 | name: '', 15 | type: 'uint256', 16 | }, 17 | ], 18 | stateMutability: 'view', 19 | type: 'function', 20 | }, 21 | ] as const; 22 | 23 | export { ERC20PERMIT_NONCES_ABI }; 24 | -------------------------------------------------------------------------------- /js/frontend/src/features/history/components/pending-transactions-warning/pending-transactions-warning.module.scss: -------------------------------------------------------------------------------- 1 | .container { 2 | padding: 8px; 3 | 4 | display: flex; 5 | align-items: center; 6 | gap: 16px; 7 | 8 | text-align: center; 9 | font-size: 12px; 10 | color: #fdd87c; 11 | 12 | background-color: #fdd87c1a; 13 | border: 1px solid #fdd87c1a; 14 | border-radius: 8px; 15 | 16 | svg path { 17 | fill: #fdd87c; 18 | } 19 | 20 | a { 21 | text-decoration: underline; 22 | } 23 | 24 | p { 25 | flex: 1; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /js/frontend/src/features/token-tracker/components/balance-card/balance-card.module.scss: -------------------------------------------------------------------------------- 1 | .card { 2 | padding: 16px; 3 | 4 | display: flex; 5 | align-items: center; 6 | justify-content: space-between; 7 | gap: 16px; 8 | flex-wrap: wrap; 9 | 10 | background-color: #ffffff03; 11 | border: 1px solid #ffffff0a; 12 | border-radius: 6px; 13 | } 14 | 15 | .balance { 16 | --token-icon-size: 24px; 17 | 18 | display: flex; 19 | align-items: center; 20 | gap: 8px; 21 | 22 | font-weight: 500; 23 | line-height: 24px; 24 | color: #f6f6f6e5; 25 | } 26 | -------------------------------------------------------------------------------- /circuits/plonky2_ecdsa/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "plonky2_ecdsa" 3 | description = "ECDSA gadget for Plonky2" 4 | version = "0.1.0" 5 | license = "MIT OR Apache-2.0" 6 | edition = "2021" 7 | 8 | [features] 9 | parallel = ["plonky2_maybe_rayon/parallel", "plonky2/parallel"] 10 | 11 | [dependencies] 12 | anyhow.workspace = true 13 | itertools.workspace = true 14 | plonky2_maybe_rayon.workspace = true 15 | num.workspace = true 16 | plonky2.workspace = true 17 | plonky2_u32.workspace = true 18 | serde.workspace = true 19 | 20 | [dev-dependencies] 21 | rand.workspace = true 22 | -------------------------------------------------------------------------------- /js/frontend/src/features/swap/components/swap-network-button/swap-network-button.tsx: -------------------------------------------------------------------------------- 1 | import SwapSVG from '../../assets/swap.svg?react'; 2 | import { useBridgeContext } from '../../context'; 3 | 4 | import styles from './swap-network-button.module.scss'; 5 | 6 | function SwapNetworkButton() { 7 | const { network } = useBridgeContext(); 8 | 9 | return ( 10 | 13 | ); 14 | } 15 | 16 | export { SwapNetworkButton }; 17 | -------------------------------------------------------------------------------- /js/frontend/src/hooks/use-eth-account-balance.ts: -------------------------------------------------------------------------------- 1 | import { useBalance } from 'wagmi'; 2 | 3 | import { useInvalidateOnBlock } from './common'; 4 | import { useEthAccount } from './use-eth-account'; 5 | 6 | function useEthAccountBalance() { 7 | const ethAccount = useEthAccount(); 8 | 9 | const state = useBalance({ 10 | address: ethAccount?.address, 11 | query: { select: ({ value }) => value }, 12 | }); 13 | 14 | const { queryKey } = state; 15 | useInvalidateOnBlock({ queryKey }); 16 | 17 | return state; 18 | } 19 | 20 | export { useEthAccountBalance }; 21 | -------------------------------------------------------------------------------- /ethereum_beacon_client/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "ethereum_beacon_client" 3 | version.workspace = true 4 | edition.workspace = true 5 | 6 | [dependencies] 7 | anyhow.workspace = true 8 | ark-serialize = { workspace = true, features = ["std"] } 9 | checkpoint-light-client-io = { workspace = true, features = ["std"] } 10 | ethereum-common = { workspace = true, features = ["std"] } 11 | futures.workspace = true 12 | hex = { workspace = true, features = ["std"] } 13 | reqwest.workspace = true 14 | serde = { workspace = true, features = ["std"] } 15 | serde_json.workspace = true 16 | -------------------------------------------------------------------------------- /gear-programs/checkpoint-light-client/client/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "checkpoint-light-client-client" 3 | version.workspace = true 4 | edition.workspace = true 5 | 6 | [dependencies] 7 | checkpoint-light-client-io.workspace = true 8 | ethereum-common.workspace = true 9 | mockall = { workspace = true, optional = true } 10 | sails-rs.workspace = true 11 | 12 | [build-dependencies] 13 | checkpoint-light-client-app.workspace = true 14 | sails-client-gen.workspace = true 15 | sails-idl-gen.workspace = true 16 | 17 | [features] 18 | mocks = ["sails-rs/mockall", "dep:mockall"] 19 | -------------------------------------------------------------------------------- /js/frontend/public/site.webmanifest: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Vara Network Bridge", 3 | "short_name": "Vara Bridge", 4 | "icons": [ 5 | { 6 | "src": "/favicon/web-app-manifest-192x192.png", 7 | "sizes": "192x192", 8 | "type": "image/png", 9 | "purpose": "maskable" 10 | }, 11 | { 12 | "src": "/favicon/web-app-manifest-512x512.png", 13 | "sizes": "512x512", 14 | "type": "image/png", 15 | "purpose": "maskable" 16 | } 17 | ], 18 | "theme_color": "#14191f", 19 | "background_color": "#14191f", 20 | "display": "standalone" 21 | } -------------------------------------------------------------------------------- /js/frontend/src/features/swap/hooks/vara/use-prepare-request-bridging.ts: -------------------------------------------------------------------------------- 1 | import { usePrepareProgramTransaction } from '@gear-js/react-hooks'; 2 | 3 | import { useVFTManagerProgram } from './use-vft-manager-program'; 4 | 5 | function usePrepareRequestBridging() { 6 | const { data: program } = useVFTManagerProgram(); 7 | 8 | return { 9 | program, 10 | 11 | ...usePrepareProgramTransaction({ 12 | program, 13 | serviceName: 'vftManager', 14 | functionName: 'requestBridging', 15 | }), 16 | }; 17 | } 18 | 19 | export { usePrepareRequestBridging }; 20 | -------------------------------------------------------------------------------- /gear-rpc-client/src/metadata/mod.rs: -------------------------------------------------------------------------------- 1 | #![allow(dead_code, unused_imports, non_camel_case_types)] 2 | #![allow(clippy::all)] 3 | #![allow(unused)] 4 | 5 | pub mod errors; 6 | mod generated; 7 | mod impls; 8 | 9 | pub use self::{ 10 | errors::ModuleError, 11 | generated::{ 12 | calls::{self, CallInfo}, 13 | exports::*, 14 | runtime_types::runtime_types::{ 15 | self, sp_runtime::DispatchError, vara_runtime, vara_runtime::RuntimeEvent as Event, 16 | }, 17 | storage::{self, StorageInfo}, 18 | }, 19 | impls::Convert, 20 | }; 21 | -------------------------------------------------------------------------------- /js/bridge-js/js-test/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "js-test" 3 | version.workspace = true 4 | edition.workspace = true 5 | 6 | [dependencies] 7 | relayer.workspace = true 8 | ethereum_beacon_client.workspace = true 9 | ethereum-client.workspace = true 10 | gclient.workspace = true 11 | tokio.workspace = true 12 | hex.workspace = true 13 | gsdk.workspace = true 14 | sails-rs.workspace = true 15 | dotenv.workspace = true 16 | primitive-types.workspace = true 17 | keccak-hash.workspace = true 18 | gear-rpc-client.workspace = true 19 | alloy.workspace = true 20 | reqwest.workspace = true 21 | -------------------------------------------------------------------------------- /gear-programs/checkpoint-light-client/README.md: -------------------------------------------------------------------------------- 1 | ## The **checkpoint-light-client** program 2 | 3 | The program workspace includes the following packages: 4 | - `checkpoint-light-client` is the package allowing to build WASM binary for the program and IDL file for it. 5 | - `checkpoint-light-client-app` is the package containing business logic for the program represented by the `CheckpointLightClientService` structure. 6 | - `checkpoint-light-client-client` is the package containing the client for the program allowing to interact with it from another program, tests, or 7 | off-chain client. 8 | 9 | -------------------------------------------------------------------------------- /gear-programs/checkpoint-light-client/app/src/services/mod.rs: -------------------------------------------------------------------------------- 1 | mod checkpoint; 2 | mod replay_back; 3 | mod state; 4 | pub mod sync_update; 5 | 6 | pub use checkpoint::CheckpointFor; 7 | use ethereum_common::Hash256; 8 | pub use replay_back::ReplayBack; 9 | use sails_rs::prelude::*; 10 | pub use state::State; 11 | pub use sync_update::SyncUpdate; 12 | 13 | #[sails_rs::event] 14 | #[derive(Encode, TypeInfo)] 15 | #[codec(crate = sails_rs::scale_codec)] 16 | #[scale_info(crate = sails_rs::scale_info)] 17 | pub enum Event { 18 | NewCheckpoint { slot: u64, tree_hash_root: Hash256 }, 19 | } 20 | -------------------------------------------------------------------------------- /js/frontend/src/features/swap/assets/circle-check.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /js/frontend/src/features/wallet/components/wallet/wallet.module.scss: -------------------------------------------------------------------------------- 1 | .container { 2 | display: flex; 3 | gap: 16px; 4 | 5 | @include sm { 6 | flex-direction: column; 7 | align-items: center; 8 | } 9 | } 10 | 11 | .skeleton { 12 | width: 9rem; 13 | } 14 | 15 | .container, 16 | .wallet, 17 | .skeleton { 18 | @include sm { 19 | width: 100%; 20 | 21 | * { 22 | width: 100%; 23 | } 24 | } 25 | } 26 | 27 | .wallet { 28 | display: flex; 29 | gap: 8px; 30 | } 31 | 32 | .balance { 33 | @include sm { 34 | justify-content: center; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /js/indexer/src/model/entities/gearEthBridgeMessage.model.ts: -------------------------------------------------------------------------------- 1 | import { Entity, Column, PrimaryColumn, Index } from 'typeorm'; 2 | 3 | @Entity({ name: 'gear_eth_bridge_message' }) 4 | export class GearEthBridgeMessage { 5 | constructor(props?: Partial) { 6 | Object.assign(this, props); 7 | } 8 | 9 | @PrimaryColumn() 10 | id!: string; 11 | 12 | @Index({ unique: true }) 13 | @Column({ type: 'varchar', nullable: false }) 14 | nonce!: string; 15 | 16 | @Column({ type: 'bigint', nullable: false, name: 'block_number' }) 17 | blockNumber!: bigint; 18 | } 19 | -------------------------------------------------------------------------------- /ethereum/src/interfaces/IMessageHandler.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 2 | pragma solidity ^0.8.30; 3 | 4 | /** 5 | * @dev Interface for the message handler (messages from MessageQueue). 6 | */ 7 | interface IMessageHandler { 8 | /** 9 | * @dev Handles message originated from Vara Network. 10 | * @param source Source of the message (`ActorId` from Vara Network). 11 | * @param payload Payload of the message (message from Vara Network). 12 | */ 13 | function handleMessage(bytes32 source, bytes calldata payload) external; 14 | } 15 | -------------------------------------------------------------------------------- /js/frontend/src/features/swap/components/swap-form/swap-eth-form.tsx: -------------------------------------------------------------------------------- 1 | import { useEthAccountBalance, useEthFTBalance } from '@/hooks'; 2 | 3 | import { useEthFee, useSendEthTxs, useEthTxsEstimate } from '../../hooks'; 4 | 5 | import { SwapForm } from './swap-form'; 6 | 7 | function SwapEthForm() { 8 | return ( 9 | 16 | ); 17 | } 18 | 19 | export { SwapEthForm }; 20 | -------------------------------------------------------------------------------- /js/frontend/src/assets/arrow.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /ethereum/remappings.txt: -------------------------------------------------------------------------------- 1 | src=./src 2 | test=./test 3 | script=./script 4 | @openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/ 5 | @openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/ 6 | erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/ 7 | forge-std/=lib/forge-std/src/ 8 | halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/ 9 | openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/ 10 | openzeppelin-contracts/=lib/openzeppelin-contracts/ 11 | openzeppelin-foundry-upgrades/=lib/openzeppelin-foundry-upgrades/src/ 12 | -------------------------------------------------------------------------------- /js/frontend/src/components/token-svg/token-svg.module.scss: -------------------------------------------------------------------------------- 1 | .container { 2 | flex-shrink: 0; // curently only used in TransactionPair 3 | 4 | display: flex; 5 | align-items: flex-end; 6 | } 7 | 8 | .tokenSvg, 9 | .networkSvg { 10 | flex-shrink: 0; 11 | 12 | border-radius: 50%; 13 | } 14 | 15 | .tokenSvg { 16 | width: var(--token-icon-size); 17 | height: var(--token-icon-size); 18 | } 19 | 20 | .networkSvg { 21 | width: var(--network-icon-size); 22 | height: var(--network-icon-size); 23 | margin-left: calc(var(--network-icon-size) / -2); 24 | 25 | box-shadow: -1px 0 0px 0px #000; 26 | } 27 | -------------------------------------------------------------------------------- /js/frontend/src/features/swap/components/swap-form/swap-vara-form.tsx: -------------------------------------------------------------------------------- 1 | import { useVaraFTBalance, useVaraAccountBalance } from '@/hooks'; 2 | 3 | import { useSendVaraTxs, useVaraFee, useVaraTxsEstimate } from '../../hooks'; 4 | 5 | import { SwapForm } from './swap-form'; 6 | 7 | function SwapVaraForm() { 8 | return ( 9 | 16 | ); 17 | } 18 | 19 | export { SwapVaraForm }; 20 | -------------------------------------------------------------------------------- /gear-programs/bridging-payment/app/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | 3 | use sails_rs::program; 4 | pub mod services; 5 | use services::{BridgingPayment, State}; 6 | 7 | /// Bridging Payment program. 8 | #[derive(Default)] 9 | pub struct Program; 10 | 11 | #[program] 12 | impl Program { 13 | /// Create Bridging Payment program. 14 | pub fn new(initial_state: State) -> Self { 15 | BridgingPayment::seed(initial_state); 16 | Self 17 | } 18 | 19 | /// Get Bridging Payment service. 20 | pub fn bridging_payment(&self) -> BridgingPayment { 21 | BridgingPayment::new() 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /js/frontend/src/components/card/card.tsx: -------------------------------------------------------------------------------- 1 | import { ComponentPropsWithoutRef, ElementType, PropsWithChildren } from 'react'; 2 | 3 | import { cx } from '@/utils'; 4 | 5 | import styles from './card.module.scss'; 6 | 7 | type Props = PropsWithChildren & 8 | ComponentPropsWithoutRef & { 9 | as?: T; 10 | className?: string; 11 | }; 12 | 13 | function Card({ as, className, ...props }: Props) { 14 | const Element = as || 'div'; 15 | 16 | return ; 17 | } 18 | 19 | export { Card }; 20 | -------------------------------------------------------------------------------- /js/frontend/src/hooks/common/use-change-effect.ts: -------------------------------------------------------------------------------- 1 | import { EffectCallback, DependencyList, useRef, useEffect } from 'react'; 2 | 3 | function useChangeEffect(callback: EffectCallback, dependencies?: DependencyList) { 4 | const mounted = useRef(false); 5 | 6 | useEffect( 7 | () => () => { 8 | mounted.current = false; 9 | }, 10 | [], 11 | ); 12 | 13 | useEffect(() => { 14 | if (mounted.current) return callback(); 15 | 16 | mounted.current = true; 17 | // eslint-disable-next-line react-hooks/exhaustive-deps 18 | }, dependencies); 19 | } 20 | 21 | export { useChangeEffect }; 22 | -------------------------------------------------------------------------------- /gear-programs/vft-manager/README.md: -------------------------------------------------------------------------------- 1 | ## The **vft-manager** program 2 | 3 | The program workspace includes the following packages: 4 | - `vft-manager` is the package allowing to build WASM binary for the program and IDL file for it. 5 | The package also includes integration tests for the program in the `tests` sub-folder 6 | - `vft-manager-app` is the package containing business logic for the program represented by the `VftManagerService` structure. 7 | - `vft-manager-client` is the package containing the client for the program allowing to interact with it from another program, tests, or 8 | off-chain client. 9 | 10 | -------------------------------------------------------------------------------- /js/frontend/src/features/swap/components/fee-and-time-footer/fee-and-time-footer.module.scss: -------------------------------------------------------------------------------- 1 | .footer { 2 | display: flex; 3 | flex-direction: column; 4 | gap: 6px; 5 | } 6 | 7 | .prop { 8 | display: grid; 9 | grid-template-columns: 2.3fr 7.7fr; 10 | gap: 16px; 11 | 12 | font-size: 14px; 13 | line-height: 20px; 14 | } 15 | 16 | .key { 17 | color: #9cacb1; 18 | white-space: nowrap; 19 | 20 | svg { 21 | margin-right: 8px; 22 | } 23 | } 24 | 25 | .value { 26 | display: flex; 27 | justify-content: space-between; 28 | flex-wrap: wrap; 29 | gap: 4px; 30 | 31 | color: #f6f6f6e5; 32 | } 33 | -------------------------------------------------------------------------------- /js/indexer/src/gear/handlers/eth-bridge.ts: -------------------------------------------------------------------------------- 1 | import { EthBridgeMessageQueuedContext } from '../types/index.js'; 2 | import { GearEthBridgeMessage } from '../../model/index.js'; 3 | import { gearNonce } from '../../common/index.js'; 4 | 5 | export function handleEthBridgeMessage(ctx: EthBridgeMessageQueuedContext) { 6 | const { 7 | message: { nonce }, 8 | hash, 9 | } = ctx.event.args; 10 | 11 | ctx.state.addEthBridgeMessage( 12 | new GearEthBridgeMessage({ 13 | id: hash, 14 | nonce: gearNonce(BigInt(nonce)), 15 | blockNumber: BigInt(ctx.blockHeader.height), 16 | }), 17 | ); 18 | } 19 | -------------------------------------------------------------------------------- /js/frontend/src/features/swap/hooks/vara/use-prepare-approve.ts: -------------------------------------------------------------------------------- 1 | import { usePrepareProgramTransaction } from '@gear-js/react-hooks'; 2 | 3 | import { useVFTProgram } from '@/hooks'; 4 | 5 | import { useBridgeContext } from '../../context'; 6 | 7 | function usePrepareApprove() { 8 | const { token } = useBridgeContext(); 9 | const { data: program } = useVFTProgram(token?.address); 10 | 11 | return { 12 | program, 13 | 14 | ...usePrepareProgramTransaction({ 15 | program, 16 | serviceName: 'vft', 17 | functionName: 'approve', 18 | }), 19 | }; 20 | } 21 | 22 | export { usePrepareApprove }; 23 | -------------------------------------------------------------------------------- /js/frontend/src/pages/connect-wallet/connect-wallet.module.scss: -------------------------------------------------------------------------------- 1 | .container { 2 | flex: 1; 3 | 4 | display: flex; 5 | flex-direction: column; 6 | align-items: center; 7 | justify-content: center; 8 | } 9 | 10 | // same as in faq 11 | .heading, 12 | .subheading { 13 | text-align: center; 14 | } 15 | 16 | .heading { 17 | margin-bottom: 16px; 18 | 19 | text-align: center; 20 | font-size: 40px; 21 | font-weight: 700; 22 | line-height: 120%; 23 | } 24 | 25 | .subheading { 26 | max-width: 465px; 27 | margin-bottom: 64px; 28 | 29 | font-size: 16px; 30 | line-height: 140%; 31 | color: #f6f6f6e5; 32 | } 33 | -------------------------------------------------------------------------------- /js/indexer/db/migrations/1760014621133-is_priority_fee_paid.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @typedef {import('typeorm').MigrationInterface} MigrationInterface 3 | */ 4 | 5 | /** 6 | * @class 7 | * @implements {MigrationInterface} 8 | */ 9 | export default class IsPriorityFeePaid1760014621133 { 10 | name = 'IsPriorityFeePaid1760014621133'; 11 | 12 | async up(queryRunner) { 13 | await queryRunner.query(`ALTER TABLE "transfer" ADD "is_priority_fee_paid" boolean NOT NULL DEFAULT false`); 14 | } 15 | 16 | async down(queryRunner) { 17 | await queryRunner.query(`ALTER TABLE "transfer" DROP COLUMN "is_priority_fee_paid"`); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /tools/deploy-to-gear/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "deploy-to-gear" 3 | version.workspace = true 4 | edition.workspace = true 5 | 6 | [dependencies] 7 | vft = { workspace = true, features = ["wasm-binary"] } 8 | vft-client.workspace = true 9 | vft-vara = { workspace = true, features = ["wasm-binary"] } 10 | vft-vara-client.workspace = true 11 | 12 | clap.workspace = true 13 | dotenv.workspace = true 14 | gear-common.workspace = true 15 | gear-core.workspace = true 16 | gclient.workspace = true 17 | gsdk.workspace = true 18 | hex.workspace = true 19 | sails-rs = { workspace = true, features = ["gclient"] } 20 | tokio.workspace = true 21 | -------------------------------------------------------------------------------- /tools/vft-manager-tool/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "vft-manager-tool" 3 | version.workspace = true 4 | edition.workspace = true 5 | 6 | [dependencies] 7 | anyhow.workspace = true 8 | clap.workspace = true 9 | dotenv.workspace = true 10 | gear-common.workspace = true 11 | gear-core.workspace = true 12 | gclient.workspace = true 13 | gsdk.workspace = true 14 | hex.workspace = true 15 | log.workspace = true 16 | pretty_env_logger.workspace = true 17 | sails-rs = { workspace = true, features = ["gclient"] } 18 | tokio.workspace = true 19 | vft-manager = { workspace = true, features = ["wasm-binary"] } 20 | vft-manager-client.workspace = true 21 | -------------------------------------------------------------------------------- /circuits/plonky2_sha512/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "plonky2_sha512" 3 | edition.workspace = true 4 | version.workspace = true 5 | 6 | [dependencies] 7 | anyhow.workspace = true 8 | itertools.workspace = true 9 | keccak-hash.workspace = true 10 | log.workspace = true 11 | num.workspace = true 12 | plonky2.workspace = true 13 | plonky2_ecdsa.workspace = true 14 | plonky2_field.workspace = true 15 | plonky2_u32.workspace = true 16 | plonky2_util.workspace = true 17 | rand.workspace = true 18 | rand_chacha.workspace = true 19 | rayon.workspace = true 20 | serde.workspace = true 21 | static_assertions.workspace = true 22 | unroll.workspace = true 23 | -------------------------------------------------------------------------------- /gear-programs/historical-proxy/README.md: -------------------------------------------------------------------------------- 1 | ## The **historical-proxy** program 2 | 3 | The program workspace includes the following packages: 4 | - `historical-proxy` is the package allowing to build WASM binary for the program and IDL file for it. 5 | The package also includes integration tests for the program in the `tests` sub-folder 6 | - `historical-proxy-app` is the package containing business logic for the program represented by the `HistoricalProxyService` structure. 7 | - `historical-proxy-client` is the package containing the client for the program allowing to interact with it from another program, tests, or 8 | off-chain client. 9 | 10 | -------------------------------------------------------------------------------- /js/frontend/src/pages/transaction/section-card.tsx: -------------------------------------------------------------------------------- 1 | import { PropsWithChildren } from 'react'; 2 | 3 | import { Card } from '@/components'; 4 | 5 | import styles from './transaction.module.scss'; 6 | 7 | type Props = PropsWithChildren & { 8 | heading: string; 9 | gridContent?: boolean; 10 | }; 11 | 12 | function SectionCard({ heading, children, gridContent = true }: Props) { 13 | return ( 14 | 15 |

{heading}

16 |
{children}
17 |
18 | ); 19 | } 20 | 21 | export { SectionCard }; 22 | -------------------------------------------------------------------------------- /ethereum/src/interfaces/IMessageHandlerMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 2 | pragma solidity ^0.8.30; 3 | 4 | import {IMessageHandler} from "./IMessageHandler.sol"; 5 | 6 | /** 7 | * @dev Interface for the MessageHandlerMock contract. 8 | */ 9 | interface IMessageHandlerMock is IMessageHandler { 10 | /** 11 | * @dev Emitted when the message is handled. 12 | * @param source Source of the message (`ActorId` from Vara Network). 13 | * @param payload Payload of the message (message from Vara Network). 14 | */ 15 | event MessageHandled(bytes32 indexed source, bytes payload); 16 | } 17 | -------------------------------------------------------------------------------- /js/frontend/src/components/address/address.tsx: -------------------------------------------------------------------------------- 1 | import { ComponentProps } from 'react'; 2 | 3 | import { getTruncatedText } from '@/utils'; 4 | 5 | import { Tooltip } from '../tooltip'; 6 | 7 | type Props = { 8 | value: string; 9 | prefixLength?: number; 10 | className?: string; 11 | tooltip?: { side?: ComponentProps['side'] }; 12 | }; 13 | 14 | function Address({ value, prefixLength, className, tooltip }: Props) { 15 | return ( 16 | 17 | {getTruncatedText(value, prefixLength)} 18 | 19 | ); 20 | } 21 | 22 | export { Address }; 23 | -------------------------------------------------------------------------------- /gear-programs/vft/client/build.rs: -------------------------------------------------------------------------------- 1 | use sails_client_gen::ClientGenerator; 2 | use std::{env, path::PathBuf}; 3 | 4 | fn main() { 5 | let out_dir_path = PathBuf::from(env::var("OUT_DIR").unwrap()); 6 | let idl_file_path = out_dir_path.join("vft.idl"); 7 | 8 | // Generate IDL file for the program 9 | sails_idl_gen::generate_idl_to_file::(&idl_file_path).unwrap(); 10 | 11 | // Generate client code from IDL file 12 | ClientGenerator::from_idl_path(&idl_file_path) 13 | .with_mocks("mocks") 14 | .generate_to(PathBuf::from(env::var("OUT_DIR").unwrap()).join("vft_client.rs")) 15 | .unwrap(); 16 | } 17 | -------------------------------------------------------------------------------- /js/frontend/src/features/token-tracker/hooks/use-burn-vara-tokens.ts: -------------------------------------------------------------------------------- 1 | import { useSendProgramTransaction } from '@gear-js/react-hooks'; 2 | 3 | import { useWrappedVaraProgram } from '@/hooks'; 4 | 5 | function useBurnVaraTokens() { 6 | const { data: program } = useWrappedVaraProgram(); 7 | 8 | const { sendTransactionAsync, isPending } = useSendProgramTransaction({ 9 | program, 10 | serviceName: 'vftNativeExchange', 11 | functionName: 'burn', 12 | }); 13 | 14 | const mutateAsync = async (value: bigint) => sendTransactionAsync({ args: [value] }); 15 | 16 | return { isPending, mutateAsync }; 17 | } 18 | 19 | export { useBurnVaraTokens }; 20 | -------------------------------------------------------------------------------- /js/frontend/src/features/wallet/components/balance/balance.module.scss: -------------------------------------------------------------------------------- 1 | .balance { 2 | display: flex; 3 | align-items: center; 4 | gap: 8px; 5 | 6 | padding: 6px 16px; 7 | 8 | font-size: 14px; 9 | 10 | background-color: #13191e; 11 | border: 1px solid #00ffc466; 12 | border-radius: 4px; 13 | transition: background-color 0.25s; 14 | cursor: pointer; 15 | 16 | &:hover { 17 | background-color: #00473766; 18 | } 19 | 20 | svg { 21 | width: 16px; 22 | height: 16px; 23 | } 24 | } 25 | 26 | .skeleton { 27 | width: 9rem; 28 | 29 | // should match wallet skeleton 30 | @include sm { 31 | width: 100%; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /js/frontend/src/pages/faq/faq.module.scss: -------------------------------------------------------------------------------- 1 | .container { 2 | display: flex; 3 | flex-direction: column; 4 | align-items: center; 5 | } 6 | 7 | .heading, 8 | .subheading { 9 | text-align: center; 10 | } 11 | 12 | .heading { 13 | margin-bottom: 16px; 14 | 15 | text-align: center; 16 | font-size: 40px; 17 | font-weight: 700; 18 | line-height: 120%; 19 | } 20 | 21 | .subheading { 22 | max-width: 465px; 23 | margin-bottom: 64px; 24 | 25 | font-size: 16px; 26 | line-height: 140%; 27 | color: #f6f6f6e5; 28 | } 29 | 30 | .questions { 31 | width: 100%; 32 | 33 | display: flex; 34 | flex-direction: column; 35 | gap: 16px; 36 | } 37 | -------------------------------------------------------------------------------- /js/indexer/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "ESNext", 4 | "target": "es2022", 5 | "moduleResolution": "node", 6 | "outDir": "lib", 7 | "rootDir": "src", 8 | "strict": true, 9 | "declaration": false, 10 | "sourceMap": true, 11 | "esModuleInterop": true, 12 | "allowSyntheticDefaultImports": true, 13 | "experimentalDecorators": true, 14 | "emitDecoratorMetadata": true, 15 | "skipLibCheck": true, 16 | "resolveJsonModule": true, 17 | "strictPropertyInitialization": false, 18 | "noImplicitAny": false 19 | }, 20 | "include": ["src"], 21 | "exclude": ["node_modules"] 22 | } 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | .vscode 3 | .idea 4 | data/ 5 | /proof_storage 6 | /block_finality_storage 7 | /onchain_proof_storage_data 8 | _obj 9 | .binpath 10 | 11 | cache/ 12 | out/ 13 | tmp/ 14 | 15 | ethereum/broadcast 16 | ethereum/coverage 17 | ethereum/lcov.info 18 | 19 | .env 20 | deployment.toml 21 | .DS_Store 22 | 23 | .direnv/ 24 | 25 | # js 26 | node_modules/ 27 | js/bridge-js/lib/ 28 | js/common/lib/ 29 | js/indexer/lib/ 30 | js/frontend/dist/ 31 | js/indexer/assets/ 32 | js/**/*.log 33 | *.log 34 | **/.yarn/* 35 | !.yarn/patches 36 | !.yarn/plugins 37 | !.yarn/releases 38 | !.yarn/sdks 39 | !.yarn/versions 40 | js/bridge-js/js-test/contracts/broadcast/ 41 | -------------------------------------------------------------------------------- /ethereum/test/script/upgrades/WrappedVara.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 2 | pragma solidity ^0.8.30; 3 | 4 | import {Test} from "forge-std/Test.sol"; 5 | import {WrappedVaraScript} from "script/upgrades/WrappedVara.s.sol"; 6 | 7 | contract WrappedVaraScriptTest is Test { 8 | function setUp() public {} 9 | 10 | function test_Upgrade() public { 11 | /// forge-lint: disable-next-line(unsafe-cheatcode) 12 | vm.setEnv("PRIVATE_KEY", "1"); 13 | WrappedVaraScript upgradeScript = new WrappedVaraScript(); 14 | upgradeScript.setUp(); 15 | upgradeScript.run(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /ethereum/test/script/upgrades/ERC20Manager.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 2 | pragma solidity ^0.8.30; 3 | 4 | import {Test} from "forge-std/Test.sol"; 5 | import {ERC20ManagerScript} from "script/upgrades/ERC20Manager.s.sol"; 6 | 7 | contract ERC20ManagerScriptTest is Test { 8 | function setUp() public {} 9 | 10 | function test_Upgrade() public { 11 | /// forge-lint: disable-next-line(unsafe-cheatcode) 12 | vm.setEnv("PRIVATE_KEY", "1"); 13 | ERC20ManagerScript upgradeScript = new ERC20ManagerScript(); 14 | upgradeScript.setUp(); 15 | upgradeScript.run(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /ethereum/test/script/upgrades/MessageQueue.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 2 | pragma solidity ^0.8.30; 3 | 4 | import {Test} from "forge-std/Test.sol"; 5 | import {MessageQueueScript} from "script/upgrades/MessageQueue.s.sol"; 6 | 7 | contract MessageQueueScriptTest is Test { 8 | function setUp() public {} 9 | 10 | function test_Upgrade() public { 11 | /// forge-lint: disable-next-line(unsafe-cheatcode) 12 | vm.setEnv("PRIVATE_KEY", "1"); 13 | MessageQueueScript upgradeScript = new MessageQueueScript(); 14 | upgradeScript.setUp(); 15 | upgradeScript.run(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /ethereum/test/script/upgrades/VerifierMock.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 2 | pragma solidity ^0.8.30; 3 | 4 | import {Test} from "forge-std/Test.sol"; 5 | import {VerifierMockScript} from "script/upgrades/VerifierMock.s.sol"; 6 | 7 | contract VerifierMockScriptTest is Test { 8 | function setUp() public {} 9 | 10 | function test_Upgrade() public { 11 | /// forge-lint: disable-next-line(unsafe-cheatcode) 12 | vm.setEnv("PRIVATE_KEY", "1"); 13 | VerifierMockScript upgradeScript = new VerifierMockScript(); 14 | upgradeScript.setUp(); 15 | upgradeScript.run(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /js/indexer/db/migrations/1753370188946-comments.js: -------------------------------------------------------------------------------- 1 | export default class Comments1753370188946 { 2 | name = 'Comments1753370188946'; 3 | 4 | async up(queryRunner) { 5 | // Omit unnecessary tables in GraphQL schema 6 | await queryRunner.query(`COMMENT ON TABLE initiated_transfer IS E'@omit'`); 7 | await queryRunner.query(`COMMENT ON TABLE completed_transfer IS E'@omit'`); 8 | await queryRunner.query(`COMMENT ON TABLE vara_bridge_program IS E'@omit'`); 9 | await queryRunner.query(`COMMENT ON TABLE eth_bridge_program IS E'@omit'`); 10 | await queryRunner.query(`COMMENT ON TABLE migrations IS E'@omit'`); 11 | } 12 | 13 | async down() {} 14 | } 15 | -------------------------------------------------------------------------------- /gear-programs/vft-manager/app/build.rs: -------------------------------------------------------------------------------- 1 | use sails_client_gen::ClientGenerator; 2 | use std::{env, path::PathBuf}; 3 | 4 | fn main() { 5 | let mut dir_manifest = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap()); 6 | dir_manifest.pop(); 7 | dir_manifest.pop(); 8 | dir_manifest.pop(); 9 | 10 | dir_manifest.push("api"); 11 | dir_manifest.push("gear"); 12 | let path_idl_file = dir_manifest.join("vft_manager.idl"); 13 | 14 | // Generate client code from IDL file 15 | ClientGenerator::from_idl_path(&path_idl_file) 16 | .generate_to(PathBuf::from(env::var("OUT_DIR").unwrap()).join("vft_manager_client.rs")) 17 | .unwrap(); 18 | } 19 | -------------------------------------------------------------------------------- /gear-programs/vft-vara/client/build.rs: -------------------------------------------------------------------------------- 1 | use sails_client_gen::ClientGenerator; 2 | use std::{env, path::PathBuf}; 3 | 4 | fn main() { 5 | let out_dir_path = PathBuf::from(env::var("OUT_DIR").unwrap()); 6 | let idl_file_path = out_dir_path.join("vft_vara.idl"); 7 | 8 | // Generate IDL file for the program 9 | sails_idl_gen::generate_idl_to_file::(&idl_file_path).unwrap(); 10 | 11 | // Generate client code from IDL file 12 | ClientGenerator::from_idl_path(&idl_file_path) 13 | .with_mocks("mocks") 14 | .generate_to(PathBuf::from(env::var("OUT_DIR").unwrap()).join("vft_vara_client.rs")) 15 | .unwrap(); 16 | } 17 | -------------------------------------------------------------------------------- /js/frontend/src/hooks/use-vara-ft-balance.ts: -------------------------------------------------------------------------------- 1 | import { HexString } from '@gear-js/api'; 2 | import { useAccount, useProgramQuery } from '@gear-js/react-hooks'; 3 | 4 | import { useVFTProgram } from './use-vft-program'; 5 | 6 | function useVaraFTBalance(address: HexString | undefined) { 7 | const { account } = useAccount(); 8 | 9 | const { data: program } = useVFTProgram(address); 10 | 11 | return useProgramQuery({ 12 | program, 13 | serviceName: 'vft', 14 | functionName: 'balanceOf', 15 | args: [account?.decodedAddress || '0x00'], 16 | query: { enabled: Boolean(account) }, 17 | watch: true, 18 | }); 19 | } 20 | 21 | export { useVaraFTBalance }; 22 | -------------------------------------------------------------------------------- /js/frontend/src/features/history/components/list/list.module.scss: -------------------------------------------------------------------------------- 1 | .list { 2 | display: flex; 3 | flex-direction: column; 4 | gap: 8px; 5 | } 6 | 7 | .button { 8 | margin-top: 16px; 9 | } 10 | 11 | .notFound { 12 | margin: 0 auto; 13 | padding: 100px; 14 | 15 | display: flex; 16 | align-items: center; 17 | flex-direction: column; 18 | gap: 16px; 19 | 20 | text-align: center; 21 | 22 | .heading { 23 | font-size: 32px; 24 | font-weight: 600; 25 | line-height: 110%; 26 | letter-spacing: 0.01em; 27 | } 28 | 29 | .text { 30 | font-size: 16px; 31 | font-weight: 500; 32 | line-height: 150%; 33 | opacity: 0.7; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /js/frontend/src/features/swap/hooks/index.ts: -------------------------------------------------------------------------------- 1 | import { useSendEthTxs, useEthTxsEstimate, useEthFee, useRelayEthTx, useIsEthRelayAvailable } from './eth'; 2 | import { useSwapForm } from './use-swap-form'; 3 | import { 4 | useVaraFee, 5 | useSendVaraTxs, 6 | useVaraTxsEstimate, 7 | usePayVaraFee, 8 | useRelayVaraTx, 9 | useIsVaraRelayAvailable, 10 | } from './vara'; 11 | 12 | export { 13 | useSendEthTxs, 14 | useEthTxsEstimate, 15 | useEthFee, 16 | useSwapForm, 17 | useVaraFee, 18 | useSendVaraTxs, 19 | useVaraTxsEstimate, 20 | usePayVaraFee, 21 | useRelayVaraTx, 22 | useRelayEthTx, 23 | useIsEthRelayAvailable, 24 | useIsVaraRelayAvailable, 25 | }; 26 | -------------------------------------------------------------------------------- /js/indexer/src/eth/abi/abi.support.ts: -------------------------------------------------------------------------------- 1 | import assert from 'assert'; 2 | import * as ethers from 'ethers'; 3 | 4 | export interface LogRecord { 5 | topics: string[]; 6 | data: string; 7 | } 8 | 9 | export class LogEvent { 10 | private fragment: ethers.EventFragment; 11 | 12 | constructor( 13 | private abi: ethers.Interface, 14 | public readonly topic: string, 15 | ) { 16 | const fragment = abi.getEvent(topic); 17 | assert(fragment != null, 'Missing fragment'); 18 | this.fragment = fragment; 19 | } 20 | 21 | decode(rec: LogRecord): Args { 22 | return this.abi.decodeEventLog(this.fragment, rec.data, rec.topics) as any as Args; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /ethereum/test/script/upgrades/VerifierMainnet.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 2 | pragma solidity ^0.8.30; 3 | 4 | import {Test} from "forge-std/Test.sol"; 5 | import {VerifierMainnetScript} from "script/upgrades/VerifierMainnet.s.sol"; 6 | 7 | contract VerifierMainnetScriptTest is Test { 8 | function setUp() public {} 9 | 10 | function test_Upgrade() public { 11 | /// forge-lint: disable-next-line(unsafe-cheatcode) 12 | vm.setEnv("PRIVATE_KEY", "1"); 13 | VerifierMainnetScript upgradeScript = new VerifierMainnetScript(); 14 | upgradeScript.setUp(); 15 | upgradeScript.run(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /ethereum/test/script/upgrades/VerifierTestnet.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 2 | pragma solidity ^0.8.30; 3 | 4 | import {Test} from "forge-std/Test.sol"; 5 | import {VerifierTestnetScript} from "script/upgrades/VerifierTestnet.s.sol"; 6 | 7 | contract VerifierTestnetScriptTest is Test { 8 | function setUp() public {} 9 | 10 | function test_Upgrade() public { 11 | /// forge-lint: disable-next-line(unsafe-cheatcode) 12 | vm.setEnv("PRIVATE_KEY", "1"); 13 | VerifierTestnetScript upgradeScript = new VerifierTestnetScript(); 14 | upgradeScript.setUp(); 15 | upgradeScript.run(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /gear-programs/vft-manager/client/build.rs: -------------------------------------------------------------------------------- 1 | use sails_client_gen::ClientGenerator; 2 | use std::{env, path::PathBuf}; 3 | 4 | fn main() { 5 | let out_dir_path = PathBuf::from(env::var("OUT_DIR").unwrap()); 6 | let idl_file_path = out_dir_path.join("vft_manager.idl"); 7 | 8 | // Generate IDL file for the program 9 | sails_idl_gen::generate_idl_to_file::(&idl_file_path).unwrap(); 10 | 11 | // Generate client code from IDL file 12 | ClientGenerator::from_idl_path(&idl_file_path) 13 | .with_mocks("mocks") 14 | .generate_to(PathBuf::from(env::var("OUT_DIR").unwrap()).join("vft_manager_client.rs")) 15 | .unwrap(); 16 | } 17 | -------------------------------------------------------------------------------- /js/bridge-js/js-test/contracts/script/Deploy.s.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 2 | pragma solidity ^0.8.30; 3 | 4 | import "forge-std/Script.sol"; 5 | import "src/MessageHandler.sol"; 6 | 7 | contract Deploy is Script { 8 | function run() external { 9 | uint256 privateKey = vm.envUint("PRIVATE_KEY"); 10 | 11 | vm.startBroadcast(privateKey); 12 | 13 | MessageHandler messageHandler = new MessageHandler(); 14 | 15 | vm.stopBroadcast(); 16 | 17 | console.log("MessageHandler deployed at:", address(messageHandler)); 18 | console.log("Address written to: deployed_address.txt"); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /js/frontend/codegen.ts: -------------------------------------------------------------------------------- 1 | import { CodegenConfig } from '@graphql-codegen/cli'; 2 | 3 | const config: CodegenConfig = { 4 | schema: process.env.VITE_INDEXER_ADDRESS, // needs --require dotenv/config 5 | documents: ['src/**/*.{ts,tsx}'], 6 | ignoreNoDocuments: true, // for better experience with the watcher 7 | generates: { 8 | './src/features/history/graphql/': { 9 | preset: 'client', 10 | plugins: [], 11 | config: { 12 | scalars: { 13 | Datetime: 'string', // custom subsquid scalars 14 | BigInt: 'string', 15 | }, 16 | avoidOptionals: true, 17 | }, 18 | }, 19 | }, 20 | }; 21 | 22 | export default config; 23 | -------------------------------------------------------------------------------- /js/indexer/src/eth/abi/erc20-manager.ts: -------------------------------------------------------------------------------- 1 | import * as ethers from 'ethers'; 2 | import * as fs from 'fs'; 3 | 4 | import { LogEvent } from './abi.support.js'; 5 | import { config } from '../config.js'; 6 | 7 | const ABI_JSON = JSON.parse(fs.readFileSync(`${config.apiPath}/IERC20Manager.json`, 'utf-8')); 8 | 9 | export const abi = new ethers.Interface(ABI_JSON.abi); 10 | 11 | export const events = { 12 | BridgingRequested: new LogEvent< 13 | [from: string, to: string, token: string, amount: bigint] & { 14 | from: string; 15 | to: string; 16 | token: string; 17 | amount: bigint; 18 | } 19 | >(abi, abi.getEvent('BridgingRequested')!.topicHash), 20 | }; 21 | -------------------------------------------------------------------------------- /js/frontend/src/features/swap/components/balance/balance.module.scss: -------------------------------------------------------------------------------- 1 | .balance { 2 | display: flex; 3 | align-items: center; 4 | 5 | font-size: 14px; 6 | line-height: 20px; 7 | white-space: nowrap; 8 | color: #828b8e; 9 | } 10 | 11 | .heading { 12 | margin-right: 16px; 13 | } 14 | 15 | .button { 16 | margin-left: 8px; 17 | padding: 0 8px; 18 | 19 | font-size: 12px; 20 | font-weight: 500; 21 | line-height: 24px; 22 | color: #56b99f; 23 | 24 | background-color: rgba(#00ffc4, 0.1); 25 | border-radius: 4px; 26 | 27 | transition: opacity 0.25s; 28 | 29 | &:hover { 30 | opacity: 0.5; 31 | } 32 | 33 | &:disabled { 34 | opacity: 0.25; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /gear-programs/historical-proxy/Cargo.toml: -------------------------------------------------------------------------------- 1 | 2 | 3 | [package] 4 | name = "historical-proxy" 5 | version.workspace = true 6 | edition.workspace = true 7 | 8 | [dependencies] 9 | historical-proxy-app = { path = "app" } 10 | 11 | [build-dependencies] 12 | historical-proxy-app = { path = "app" } 13 | sails-rs = { workspace = true, features = ["wasm-builder"] } 14 | sails-idl-gen.workspace = true 15 | 16 | [dev-dependencies] 17 | historical-proxy = { path = ".", features = ["wasm-binary"] } 18 | historical-proxy-client = { path = "client" } 19 | sails-rs = { workspace = true, features = ["gtest"] } 20 | tokio = { workspace = true, features = ["rt", "macros"] } 21 | 22 | [features] 23 | wasm-binary = [] 24 | -------------------------------------------------------------------------------- /js/frontend/src/features/history/hooks/index.ts: -------------------------------------------------------------------------------- 1 | import { usePairs } from './use-pairs'; 2 | import { usePendingTxsCount, useOptimisticPendingTxsCountUpdate } from './use-pending-txs-count'; 3 | import { useTransaction, useOptimisticTxUpdate } from './use-transaction'; 4 | import { useTransactionFilters } from './use-transaction-filters'; 5 | import { useTransactions } from './use-transactions'; 6 | import { useTransactionsCount } from './use-transactions-count'; 7 | 8 | export { 9 | usePairs, 10 | useTransactionsCount, 11 | useTransactions, 12 | useTransactionFilters, 13 | useTransaction, 14 | useOptimisticTxUpdate, 15 | usePendingTxsCount, 16 | useOptimisticPendingTxsCountUpdate, 17 | }; 18 | -------------------------------------------------------------------------------- /ethereum/script/upgrades/WrappedVara.s.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 2 | pragma solidity ^0.8.30; 3 | 4 | import {console, Script} from "forge-std/Script.sol"; 5 | import {WrappedVara} from "src/erc20/WrappedVara.sol"; 6 | 7 | contract WrappedVaraScript is Script { 8 | WrappedVara public wrappedVara; 9 | 10 | function setUp() public {} 11 | 12 | function run() public { 13 | uint256 privateKey = vm.envUint("PRIVATE_KEY"); 14 | 15 | vm.startBroadcast(privateKey); 16 | 17 | wrappedVara = new WrappedVara(); 18 | console.log("WrappedVara:", address(wrappedVara)); 19 | 20 | vm.stopBroadcast(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /gear-programs/bridging-payment/client/build.rs: -------------------------------------------------------------------------------- 1 | use sails_client_gen::ClientGenerator; 2 | use std::{env, path::PathBuf}; 3 | 4 | fn main() { 5 | let out_dir_path = PathBuf::from(env::var("OUT_DIR").unwrap()); 6 | let idl_file_path = out_dir_path.join("bridging_payment.idl"); 7 | 8 | // Generate IDL file for the program 9 | sails_idl_gen::generate_idl_to_file::(&idl_file_path).unwrap(); 10 | 11 | // Generate client code from IDL file 12 | ClientGenerator::from_idl_path(&idl_file_path) 13 | .with_mocks("mocks") 14 | .generate_to(PathBuf::from(env::var("OUT_DIR").unwrap()).join("bridging_payment_client.rs")) 15 | .unwrap(); 16 | } 17 | -------------------------------------------------------------------------------- /gear-programs/vft/build.rs: -------------------------------------------------------------------------------- 1 | use std::{ 2 | env, 3 | fs::File, 4 | io::{BufRead, BufReader}, 5 | path::PathBuf, 6 | }; 7 | 8 | fn main() { 9 | sails_rs::build_wasm(); 10 | 11 | if env::var("__GEAR_WASM_BUILDER_NO_BUILD").is_ok() { 12 | return; 13 | } 14 | 15 | let bin_path_file = File::open(".binpath").unwrap(); 16 | let mut bin_path_reader = BufReader::new(bin_path_file); 17 | let mut bin_path = String::new(); 18 | bin_path_reader.read_line(&mut bin_path).unwrap(); 19 | 20 | let mut idl_path = PathBuf::from(bin_path); 21 | idl_path.set_extension("idl"); 22 | sails_idl_gen::generate_idl_to_file::(idl_path).unwrap(); 23 | } 24 | -------------------------------------------------------------------------------- /js/frontend/src/features/swap/hooks/vara/use-pay-vara-fee.ts: -------------------------------------------------------------------------------- 1 | import { useProgram, useSendProgramTransaction } from '@gear-js/react-hooks'; 2 | 3 | import { useNetworkType } from '@/context/network-type'; 4 | 5 | import { BridgingPaymentProgram } from '../../consts'; 6 | 7 | function usePayVaraFee() { 8 | const { NETWORK_PRESET } = useNetworkType(); 9 | 10 | const { data: program } = useProgram({ 11 | library: BridgingPaymentProgram, 12 | id: NETWORK_PRESET.BRIDGING_PAYMENT_CONTRACT_ADDRESS, 13 | }); 14 | 15 | return useSendProgramTransaction({ 16 | program, 17 | serviceName: 'bridgingPayment', 18 | functionName: 'payFees', 19 | }); 20 | } 21 | 22 | export { usePayVaraFee }; 23 | -------------------------------------------------------------------------------- /js/indexer/src/eth/config.ts: -------------------------------------------------------------------------------- 1 | import { getEnv } from '../common/index.js'; 2 | 3 | let apiPath = getEnv('ETH_API_PATH', './api/ethereum'); 4 | 5 | apiPath = apiPath.endsWith('/') ? apiPath.slice(0, -1) : apiPath; 6 | 7 | export const config = { 8 | archiveUrl: getEnv('ETH_ARCHIVE_URL', 'https://v2.archive.subsquid.io/network/ethereum-holesky'), 9 | rpcUrl: getEnv('ETH_RPC_URL'), 10 | rateLimit: Number(getEnv('ETH_RATE_LIMIT', '10')), 11 | erc20Manager: getEnv('ETH_ERC20_MANAGER').toLowerCase(), 12 | msgQ: getEnv('ETH_MSQ_QUEUE').toLowerCase(), 13 | bridgingPayment: getEnv('ETH_BRIDGING_PAYMENT').toLowerCase(), 14 | fromBlock: Number(getEnv('ETH_FROM_BLOCK', '2636000')), 15 | apiPath, 16 | }; 17 | -------------------------------------------------------------------------------- /tests/src/historical_proxy/headers/holesky-header-2_498_458.json: -------------------------------------------------------------------------------- 1 | {"execution_optimistic":true,"finalized":true,"data":{"root":"0xf2124665a29617ddf5be9f8aba39026588334ea5c9c2339e8c4d08d88f8bb143","canonical":true,"header":{"message":{"slot":"2498458","proposer_index":"523209","parent_root":"0x754759475dba83a474bd18d7d525177f1f91c8a194b42fe89bd1860e2a35f798","state_root":"0xdc5fadf74262103b00c0918f99b53ead93fe1a5deb8e4f916e85044f0b467777","body_root":"0xeab43e2e0b6435f6efc6b5923959b8d9e1a7615e77397062ffe16cba4424d5b1"},"signature":"0x842d09e97ca87ffeb87f9469a4d8a45e5433378d596a7c56405bb80b367604f0f000bcb2a7d3c2abf5ac9d2b2be2907f0f712abba527b57f48fb43eab50ba7cf4258a982fd3da5f80513583280aab2beb4864dc04a2df31ff7cd698a3779ad14"}}} -------------------------------------------------------------------------------- /tests/src/historical_proxy/headers/holesky-header-2_498_462.json: -------------------------------------------------------------------------------- 1 | {"execution_optimistic":true,"finalized":true,"data":{"root":"0x5868065011d35bba0de8bd319a82ca840211c71784d8659fd80e83aace53e413","canonical":true,"header":{"message":{"slot":"2498462","proposer_index":"625758","parent_root":"0xb09be734cd0db1911c43cec36317edc1a64985e098cf2c906072a4c1b45d6860","state_root":"0xbad0b5e974313d931ce75737d5a7bfc977c51dbb31e495cec37df2537126b7ff","body_root":"0x62bbe4e2d2f1c1c3d64d461f721f46c035db9b4770fdf9ed135454c063118b61"},"signature":"0x96f721627de0f2eee730d7c2905d5e22a1812f6f38e4528a0529e72b9b242ed898dad5859164db0cc6ee9541c6c5246310cfdc5698122ca6751b3e86ae7b1c934d98cde15efdb240314413c6956a639c4be21ea92ad21166be2cbf3b6ebefe13"}}} -------------------------------------------------------------------------------- /tests/src/historical_proxy/headers/holesky-header-2_498_464.json: -------------------------------------------------------------------------------- 1 | {"execution_optimistic":true,"finalized":true,"data":{"root":"0xb89c6d200193f865b85a3f323b75d2b10346564a330229d8a5c695968206faf1","canonical":true,"header":{"message":{"slot":"2498464","proposer_index":"701565","parent_root":"0xeec922bdb9743f2d20b0742037e75ba8189eae7928080f27a75d9e87798db503","state_root":"0x59a8c29932670742311e175ca59df1fec4b2f346cb37574f98c2ca2da7ae4174","body_root":"0xe2de43f4dbd43e48cbb9c7e41d1645893da29fff800ae48ee3bdb67639e51aa9"},"signature":"0x89f3027e8d0d4c157cd7cd34d01ddf503df1956a466c8a691263b449ef993e8a2fabd0110fe5cc4163eec5699053c9ce04a40e666059d635ea2f153b5903c04df7be336c6a84c8c6458d431f33c3303508eba4c78595a35310ba15669d718bcc"}}} -------------------------------------------------------------------------------- /ethereum/script/upgrades/ERC20Manager.s.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 2 | pragma solidity ^0.8.30; 3 | 4 | import {console, Script} from "forge-std/Script.sol"; 5 | import {ERC20Manager} from "src/ERC20Manager.sol"; 6 | 7 | contract ERC20ManagerScript is Script { 8 | ERC20Manager public erc20Manager; 9 | 10 | function setUp() public {} 11 | 12 | function run() public { 13 | uint256 privateKey = vm.envUint("PRIVATE_KEY"); 14 | 15 | vm.startBroadcast(privateKey); 16 | 17 | erc20Manager = new ERC20Manager(); 18 | console.log("ERC20Manager:", address(erc20Manager)); 19 | 20 | vm.stopBroadcast(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /ethereum/script/upgrades/MessageQueue.s.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 2 | pragma solidity ^0.8.30; 3 | 4 | import {console, Script} from "forge-std/Script.sol"; 5 | import {MessageQueue} from "src/MessageQueue.sol"; 6 | 7 | contract MessageQueueScript is Script { 8 | MessageQueue public messageQueue; 9 | 10 | function setUp() public {} 11 | 12 | function run() public { 13 | uint256 privateKey = vm.envUint("PRIVATE_KEY"); 14 | 15 | vm.startBroadcast(privateKey); 16 | 17 | messageQueue = new MessageQueue(); 18 | console.log("MessageQueue:", address(messageQueue)); 19 | 20 | vm.stopBroadcast(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /gear-programs/vft-vara/build.rs: -------------------------------------------------------------------------------- 1 | use std::{ 2 | env, 3 | fs::File, 4 | io::{BufRead, BufReader}, 5 | path::PathBuf, 6 | }; 7 | 8 | fn main() { 9 | sails_rs::build_wasm(); 10 | 11 | if env::var("__GEAR_WASM_BUILDER_NO_BUILD").is_ok() { 12 | return; 13 | } 14 | 15 | let bin_path_file = File::open(".binpath").unwrap(); 16 | let mut bin_path_reader = BufReader::new(bin_path_file); 17 | let mut bin_path = String::new(); 18 | bin_path_reader.read_line(&mut bin_path).unwrap(); 19 | 20 | let mut idl_path = PathBuf::from(bin_path); 21 | idl_path.set_extension("idl"); 22 | sails_idl_gen::generate_idl_to_file::(idl_path).unwrap(); 23 | } 24 | -------------------------------------------------------------------------------- /tests/src/historical_proxy/headers/holesky-header-2_498_457.json: -------------------------------------------------------------------------------- 1 | {"execution_optimistic":true,"finalized":true,"data":{"root":"0x754759475dba83a474bd18d7d525177f1f91c8a194b42fe89bd1860e2a35f798","canonical":true,"header":{"message":{"slot":"2498457","proposer_index":"1366611","parent_root":"0x6296355ea27ac8b5783d61ce0c968d988a8e89df48dad837b23c0f5a664a4abd","state_root":"0xe3786597d84085e401ee2ab266e13d03f201d1fe1bb0cfeb5ad76cc22bdd3b5d","body_root":"0x87923a2a618b5ab0637e27f0459a96cdd355cdb63aa1b7d3ea0b341472e77509"},"signature":"0xb753331e0cbd7de63bff17abf9cfe9749bcdf5ddcd35046dbccc8b0e01ea2123e17a25bba4a5de8cc2f6876de258b13917f7c0cd6fe67f8b9c440aec9ea000811d6c5f6709dd6548072e148df1a90c1e3cf0beeec603d0c4ecafb3a6f3a4cdee"}}} -------------------------------------------------------------------------------- /tests/src/historical_proxy/headers/holesky-header-2_498_459.json: -------------------------------------------------------------------------------- 1 | {"execution_optimistic":true,"finalized":true,"data":{"root":"0x13a8c90e84e9617e6b17daaad28ec9957075276ad4f696b469d01324de082958","canonical":true,"header":{"message":{"slot":"2498459","proposer_index":"1634578","parent_root":"0xf2124665a29617ddf5be9f8aba39026588334ea5c9c2339e8c4d08d88f8bb143","state_root":"0xb725dbe06f05f67bbf761aee58a920a859759835e24836a928068b9a518bc604","body_root":"0x84fc78b45e6902d3859fc41418fb81f87cc84c5aca131eda46b4375803b959e0"},"signature":"0xa4c2a2521cfa2900724d64d54abbe05d68a6187813ce202e7a6b657133c2abad23f0fb3d838cafea3a4fa78b1ea4ca52008c211b14172ec22e98e6f43c19f6f2e6c49e208af5597be549846dd316f4f56c97258b0f869053cc03e10db8753f69"}}} -------------------------------------------------------------------------------- /tests/src/historical_proxy/headers/holesky-header-2_498_460.json: -------------------------------------------------------------------------------- 1 | {"execution_optimistic":true,"finalized":true,"data":{"root":"0x4581086232b3a986282dbdc1d173f6b322ab876cecb1a4765a049847a7969e33","canonical":true,"header":{"message":{"slot":"2498460","proposer_index":"1021244","parent_root":"0x13a8c90e84e9617e6b17daaad28ec9957075276ad4f696b469d01324de082958","state_root":"0x6ec45efeb0b81cb80e868043992e305f0e5984bf6c0e99a6d1b3b7963fcfec56","body_root":"0x56416759c481acd9c046eb558be05da5727338ad2bc2d1504f582c3b49e1526b"},"signature":"0xb1aba48d2b279301c8d912cc6c0bfb5e6f49c3063df18cdcd756ffc58f6266ba7e26c517a61138b3aee9711d2895cf3e19cffb2bd213db96f6862f6a9d81699a5056a9e93eb5b06063b31a5f08ad411349ef07893bbd99c25209d017ceca5b13"}}} -------------------------------------------------------------------------------- /tests/src/historical_proxy/headers/holesky-header-2_498_461.json: -------------------------------------------------------------------------------- 1 | {"execution_optimistic":true,"finalized":true,"data":{"root":"0xb09be734cd0db1911c43cec36317edc1a64985e098cf2c906072a4c1b45d6860","canonical":true,"header":{"message":{"slot":"2498461","proposer_index":"1318664","parent_root":"0x4581086232b3a986282dbdc1d173f6b322ab876cecb1a4765a049847a7969e33","state_root":"0x009d25b3a2471fb4b50e5968d6c57cf8b7209efccbf4def7f2a3f01c5f0f1706","body_root":"0xfd2dbbda0e14dd629b1f79121de8f33bff622410638cde8d1211db69738184b7"},"signature":"0x8c57ed7794f9ff15d14542af8700bd0a7e27d2e8ab9a7f740a2f62c7f8ea19d5a8d4a36507b2dec70eac58ebca4539ee16b0bb02d8190d0192d96c432824c6d6378e5fee947d61e4521d7b0bf1f68c8c3bed240aa9649cf9153d085fa83e389f"}}} -------------------------------------------------------------------------------- /tests/src/historical_proxy/headers/holesky-header-2_498_463.json: -------------------------------------------------------------------------------- 1 | {"execution_optimistic":true,"finalized":true,"data":{"root":"0xeec922bdb9743f2d20b0742037e75ba8189eae7928080f27a75d9e87798db503","canonical":true,"header":{"message":{"slot":"2498463","proposer_index":"1470084","parent_root":"0x5868065011d35bba0de8bd319a82ca840211c71784d8659fd80e83aace53e413","state_root":"0xf08a1dc7c12dc18d51be3b589ef24f7c234719a7185064e9da326de094b64547","body_root":"0x59caa3cab541fd7f64a19298349881bcd95c287581c3aba3650ce5e34f31084f"},"signature":"0x8914dee38c3cb64d5a7824d477908d0316b7c6a5f39c5255a1b914f92148a1a48583b8dbb31a1c6234fa6e89ed43dc3605b8cd46428ba81a053d434c0408fc3fb390305f73641895df73c63aa245b3d020e106e31f701445f3774f60e2e16fb7"}}} -------------------------------------------------------------------------------- /ethereum-common/src/keccak_hasher.rs: -------------------------------------------------------------------------------- 1 | use ethereum_types::H256; 2 | use hash256_std_hasher::Hash256StdHasher; 3 | use hash_db::Hasher; 4 | use tiny_keccak::{Hasher as _, Keccak}; 5 | 6 | /// Concrete `Hasher` implementation for the Keccak-256 hash 7 | #[derive(Default, Debug, Clone, PartialEq)] 8 | pub struct KeccakHasher; 9 | 10 | impl Hasher for KeccakHasher { 11 | type Out = H256; 12 | type StdHasher = Hash256StdHasher; 13 | const LENGTH: usize = 32; 14 | 15 | fn hash(x: &[u8]) -> Self::Out { 16 | let mut out = [0; 32]; 17 | 18 | let mut hasher = Keccak::v256(); 19 | hasher.update(x); 20 | hasher.finalize(&mut out); 21 | 22 | out.into() 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /ethereum/foundry.lock: -------------------------------------------------------------------------------- 1 | { 2 | "lib/forge-std": { 3 | "branch": { 4 | "name": "\"v1\"", 5 | "rev": "8e40513d678f392f398620b3ef2b418648b33e89" 6 | } 7 | }, 8 | "lib/openzeppelin-contracts": { 9 | "branch": { 10 | "name": "\"release-v5.5\"", 11 | "rev": "fcbae5394ae8ad52d8e580a3477db99814b9d565" 12 | } 13 | }, 14 | "lib/openzeppelin-contracts-upgradeable": { 15 | "branch": { 16 | "name": "\"release-v5.5\"", 17 | "rev": "aa677e9d28ed78fc427ec47ba2baef2030c58e7c" 18 | } 19 | }, 20 | "lib/openzeppelin-foundry-upgrades": { 21 | "branch": { 22 | "name": "\"main\"", 23 | "rev": "cfd861bc18ef4737e82eae6ec75304e27af699ef" 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /ethereum/src/interfaces/IPlonkVerifier.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 2 | pragma solidity ^0.8.30; 3 | 4 | /** 5 | * @dev Interface for the PlonkVerifier contract. 6 | */ 7 | interface IPlonkVerifier { 8 | /** 9 | * @dev Verify a Plonk proof. 10 | * @param proof Serialised plonk proof (using gnark's MarshalSolidity). 11 | * @param publicInputs (must be reduced). 12 | * @return success `true` if the proof passes, `false` otherwise. 13 | * @dev Reverts if the proof or the public inputs are malformed. 14 | */ 15 | function verifyProof(bytes calldata proof, uint256[] calldata publicInputs) external view returns (bool success); 16 | } 17 | -------------------------------------------------------------------------------- /js/frontend/src/components/layout/skeleton/skeleton.tsx: -------------------------------------------------------------------------------- 1 | import { ReactNode } from 'react'; 2 | 3 | import { cx } from '@/utils'; 4 | 5 | import styles from './skeleton.module.scss'; 6 | 7 | type Props = { 8 | width?: string; 9 | height?: string; 10 | borderRadius?: string; 11 | children?: ReactNode; 12 | disabled?: boolean; 13 | className?: string; 14 | }; 15 | 16 | function Skeleton({ width, height, borderRadius, children, disabled, className }: Props) { 17 | return ( 18 | 21 | {children} 22 | 23 | ); 24 | } 25 | 26 | export { Skeleton }; 27 | -------------------------------------------------------------------------------- /mock-contract/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "mock-contract" 3 | version.workspace = true 4 | edition.workspace = true 5 | 6 | [dependencies] 7 | checkpoint-light-client-client.workspace = true 8 | gstd.workspace = true 9 | hex.workspace = true 10 | hex-literal.workspace = true 11 | primitive-types.workspace = true 12 | sails-rs.workspace = true 13 | 14 | [build-dependencies] 15 | gear-wasm-builder.workspace = true 16 | 17 | [features] 18 | debug = ["gstd/debug"] 19 | std = [] 20 | default = ["std"] 21 | 22 | [target.'cfg(all(target_arch = "wasm32", target_os = "none"))'.dependencies] 23 | getrandom = { workspace = true, features = ["custom"] } 24 | lazy_static = { workspace = true, features = ["spin_no_std"] } 25 | -------------------------------------------------------------------------------- /gear-programs/vft-manager/build.rs: -------------------------------------------------------------------------------- 1 | use std::{ 2 | env, 3 | fs::File, 4 | io::{BufRead, BufReader}, 5 | path::PathBuf, 6 | }; 7 | 8 | fn main() { 9 | sails_rs::build_wasm(); 10 | 11 | if env::var("__GEAR_WASM_BUILDER_NO_BUILD").is_ok() { 12 | return; 13 | } 14 | 15 | let bin_path_file = File::open(".binpath").unwrap(); 16 | let mut bin_path_reader = BufReader::new(bin_path_file); 17 | let mut bin_path = String::new(); 18 | bin_path_reader.read_line(&mut bin_path).unwrap(); 19 | 20 | let mut idl_path = PathBuf::from(bin_path); 21 | idl_path.set_extension("idl"); 22 | sails_idl_gen::generate_idl_to_file::(idl_path).unwrap(); 23 | } 24 | -------------------------------------------------------------------------------- /js/frontend/src/pages/transactions/transactions.module.scss: -------------------------------------------------------------------------------- 1 | .filters { 2 | margin-bottom: 16px; 3 | 4 | display: grid; 5 | grid-template-columns: repeat(4, 1fr); 6 | align-items: flex-end; 7 | gap: 24px; 8 | 9 | @include sm { 10 | margin-bottom: 24px; 11 | 12 | display: flex; 13 | flex-direction: column; 14 | align-items: stretch; 15 | gap: 16px; 16 | } 17 | } 18 | 19 | .counter { 20 | margin-bottom: 16px; 21 | 22 | display: flex; 23 | align-items: center; 24 | justify-content: space-between; 25 | 26 | line-height: 140%; 27 | color: #828b8e; 28 | } 29 | 30 | .switch > span:nth-child(2) { 31 | --border-color: rgba(255, 255, 255, 0.2) !important; // overriding vara ui 32 | } 33 | -------------------------------------------------------------------------------- /gear-programs/bridging-payment/build.rs: -------------------------------------------------------------------------------- 1 | use std::{ 2 | env, 3 | fs::File, 4 | io::{BufRead, BufReader}, 5 | path::PathBuf, 6 | }; 7 | 8 | fn main() { 9 | sails_rs::build_wasm(); 10 | 11 | if env::var("__GEAR_WASM_BUILDER_NO_BUILD").is_ok() { 12 | return; 13 | } 14 | 15 | let bin_path_file = File::open(".binpath").unwrap(); 16 | let mut bin_path_reader = BufReader::new(bin_path_file); 17 | let mut bin_path = String::new(); 18 | bin_path_reader.read_line(&mut bin_path).unwrap(); 19 | 20 | let mut idl_path = PathBuf::from(bin_path); 21 | idl_path.set_extension("idl"); 22 | sails_idl_gen::generate_idl_to_file::(idl_path).unwrap(); 23 | } 24 | -------------------------------------------------------------------------------- /gear-programs/eth-events-deneb/build.rs: -------------------------------------------------------------------------------- 1 | use std::{ 2 | env, 3 | fs::File, 4 | io::{BufRead, BufReader}, 5 | path::PathBuf, 6 | }; 7 | 8 | fn main() { 9 | sails_rs::build_wasm(); 10 | 11 | if env::var("__GEAR_WASM_BUILDER_NO_BUILD").is_ok() { 12 | return; 13 | } 14 | 15 | let bin_path_file = File::open(".binpath").unwrap(); 16 | let mut bin_path_reader = BufReader::new(bin_path_file); 17 | let mut bin_path = String::new(); 18 | bin_path_reader.read_line(&mut bin_path).unwrap(); 19 | 20 | let mut idl_path = PathBuf::from(bin_path); 21 | idl_path.set_extension("idl"); 22 | sails_idl_gen::generate_idl_to_file::(idl_path).unwrap(); 23 | } 24 | -------------------------------------------------------------------------------- /gear-programs/eth-events-electra/build.rs: -------------------------------------------------------------------------------- 1 | use std::{ 2 | env, 3 | fs::File, 4 | io::{BufRead, BufReader}, 5 | path::PathBuf, 6 | }; 7 | 8 | fn main() { 9 | sails_rs::build_wasm(); 10 | 11 | if env::var("__GEAR_WASM_BUILDER_NO_BUILD").is_ok() { 12 | return; 13 | } 14 | 15 | let bin_path_file = File::open(".binpath").unwrap(); 16 | let mut bin_path_reader = BufReader::new(bin_path_file); 17 | let mut bin_path = String::new(); 18 | bin_path_reader.read_line(&mut bin_path).unwrap(); 19 | 20 | let mut idl_path = PathBuf::from(bin_path); 21 | idl_path.set_extension("idl"); 22 | sails_idl_gen::generate_idl_to_file::(idl_path).unwrap(); 23 | } 24 | -------------------------------------------------------------------------------- /gear-programs/checkpoint-light-client/app/src/services/checkpoint.rs: -------------------------------------------------------------------------------- 1 | use crate::{state::CheckpointError, State}; 2 | use cell::RefCell; 3 | use checkpoint_light_client_io::Slot; 4 | use ethereum_common::Hash256; 5 | use sails_rs::prelude::*; 6 | 7 | pub struct CheckpointFor<'a> { 8 | state: &'a RefCell, 9 | } 10 | 11 | impl<'a> CheckpointFor<'a> { 12 | pub fn new(state: &'a RefCell) -> Self { 13 | Self { state } 14 | } 15 | } 16 | 17 | #[sails_rs::service] 18 | impl<'a> CheckpointFor<'a> { 19 | #[export] 20 | pub fn get(&self, slot: Slot) -> Result<(Slot, Hash256), CheckpointError> { 21 | let state = self.state.borrow(); 22 | 23 | state.checkpoints.checkpoint(slot) 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /js/indexer/db/migrations/1761899624812-remove_checkpoint.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @typedef {import('typeorm').MigrationInterface} MigrationInterface 3 | */ 4 | 5 | /** 6 | * @class 7 | * @implements {MigrationInterface} 8 | */ 9 | export default class RemoveCheckpoint1761899624812 { 10 | name = 'RemoveCheckpoint1761899624812'; 11 | 12 | async up(queryRunner) { 13 | await queryRunner.query(`DROP TABLE checkpoint_slot`); 14 | } 15 | 16 | async down(queryRunner) { 17 | await queryRunner.query( 18 | `CREATE TABLE "checkpoint_slot" ("id" character varying NOT NULL, "slot" bigint NOT NULL, "tree_hash_root" character varying(66) NOT NULL, CONSTRAINT "PK_a040790590d41d6f590f8a604e6" PRIMARY KEY ("id"))`, 19 | ); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /gear-programs/historical-proxy/build.rs: -------------------------------------------------------------------------------- 1 | use std::{ 2 | env, 3 | fs::File, 4 | io::{BufRead, BufReader}, 5 | path::PathBuf, 6 | }; 7 | 8 | fn main() { 9 | sails_rs::build_wasm(); 10 | 11 | if env::var("__GEAR_WASM_BUILDER_NO_BUILD").is_ok() { 12 | return; 13 | } 14 | 15 | let bin_path_file = File::open(".binpath").unwrap(); 16 | let mut bin_path_reader = BufReader::new(bin_path_file); 17 | let mut bin_path = String::new(); 18 | bin_path_reader.read_line(&mut bin_path).unwrap(); 19 | 20 | let mut idl_path = PathBuf::from(bin_path); 21 | idl_path.set_extension("idl"); 22 | sails_idl_gen::generate_idl_to_file::(idl_path) 23 | .unwrap(); 24 | } 25 | -------------------------------------------------------------------------------- /gear-programs/historical-proxy/client/build.rs: -------------------------------------------------------------------------------- 1 | use sails_client_gen::ClientGenerator; 2 | use std::{env, path::PathBuf}; 3 | 4 | fn main() { 5 | let out_dir_path = PathBuf::from(env::var("OUT_DIR").unwrap()); 6 | let idl_file_path = out_dir_path.join("historical_proxy.idl"); 7 | 8 | // Generate IDL file for the program 9 | sails_idl_gen::generate_idl_to_file::( 10 | &idl_file_path, 11 | ) 12 | .unwrap(); 13 | 14 | // Generate client code from IDL file 15 | ClientGenerator::from_idl_path(&idl_file_path) 16 | .with_mocks("mocks") 17 | .generate_to(PathBuf::from(env::var("OUT_DIR").unwrap()).join("historical_proxy_client.rs")) 18 | .unwrap(); 19 | } 20 | -------------------------------------------------------------------------------- /js/frontend/src/components/form/input/input.tsx: -------------------------------------------------------------------------------- 1 | import { Input as VaraInput } from '@gear-js/vara-ui'; 2 | import { useFormContext, get, FieldError } from 'react-hook-form'; 3 | 4 | import { InputProps } from '../types'; 5 | 6 | function Input({ name, onChange, ...props }: InputProps) { 7 | const { register, formState } = useFormContext(); 8 | 9 | // use 'get' util as a safe way to access nested object properties: 10 | // https://github.com/react-hook-form/error-message/blob/2cb9e332bd4ca889ac028a423328e4b3db7d4765/src/ErrorMessage.tsx#L21 11 | const error = get(formState.errors, name) as FieldError | undefined; 12 | 13 | return ; 14 | } 15 | 16 | export { Input }; 17 | -------------------------------------------------------------------------------- /relayer/src/hex_utils.rs: -------------------------------------------------------------------------------- 1 | use primitive_types::{H160, H256}; 2 | 3 | pub fn decode_h256(hex: &str) -> anyhow::Result { 4 | let data: [u8; 32] = decode_byte_array(hex)?; 5 | Ok(data.into()) 6 | } 7 | 8 | pub fn decode_h160(hex: &str) -> anyhow::Result { 9 | let data: [u8; 20] = decode_byte_array(hex)?; 10 | Ok(data.into()) 11 | } 12 | 13 | pub fn decode_byte_array(hex: &str) -> anyhow::Result<[u8; LEN]> { 14 | decode_byte_vec(hex)? 15 | .try_into() 16 | .map_err(|_| anyhow::anyhow!("Invalid length")) 17 | } 18 | 19 | pub fn decode_byte_vec(hex: &str) -> anyhow::Result> { 20 | let address = if &hex[..2] == "0x" { &hex[2..] } else { hex }; 21 | Ok(hex::decode(address)?) 22 | } 23 | -------------------------------------------------------------------------------- /js/indexer/db/migrations/1756821384017-amount_is_string.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @typedef {import('typeorm').MigrationInterface} MigrationInterface 3 | */ 4 | 5 | /** 6 | * @class 7 | * @implements {MigrationInterface} 8 | */ 9 | export default class AmountIsString1756821384017 { 10 | name = 'AmountIsString1756821384017'; 11 | 12 | async up(queryRunner) { 13 | await queryRunner.query(`ALTER TABLE "transfer" DROP COLUMN "amount"`); 14 | await queryRunner.query(`ALTER TABLE "transfer" ADD "amount" character varying NOT NULL`); 15 | } 16 | 17 | async down(queryRunner) { 18 | await queryRunner.query(`ALTER TABLE "transfer" DROP COLUMN "amount"`); 19 | await queryRunner.query(`ALTER TABLE "transfer" ADD "amount" bigint NOT NULL`); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ethereum/script/upgrades/VerifierMock.s.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 2 | pragma solidity ^0.8.30; 3 | 4 | import {console, Script} from "forge-std/Script.sol"; 5 | import {IVerifier} from "src/interfaces/IVerifier.sol"; 6 | import {VerifierMock} from "src/mocks/VerifierMock.sol"; 7 | 8 | contract VerifierMockScript is Script { 9 | IVerifier public verifier; 10 | 11 | function setUp() public {} 12 | 13 | function run() public { 14 | uint256 privateKey = vm.envUint("PRIVATE_KEY"); 15 | 16 | vm.startBroadcast(privateKey); 17 | 18 | verifier = new VerifierMock(true); 19 | console.log("VerifierMock:", address(verifier)); 20 | 21 | vm.stopBroadcast(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /gear-programs/checkpoint-light-client/build.rs: -------------------------------------------------------------------------------- 1 | use std::{ 2 | env, 3 | fs::File, 4 | io::{BufRead, BufReader}, 5 | path::PathBuf, 6 | }; 7 | 8 | fn main() { 9 | sails_rs::build_wasm(); 10 | 11 | if env::var("__GEAR_WASM_BUILDER_NO_BUILD").is_ok() { 12 | return; 13 | } 14 | 15 | let bin_path_file = File::open(".binpath").unwrap(); 16 | let mut bin_path_reader = BufReader::new(bin_path_file); 17 | let mut bin_path = String::new(); 18 | bin_path_reader.read_line(&mut bin_path).unwrap(); 19 | 20 | let mut idl_path = PathBuf::from(bin_path); 21 | idl_path.set_extension("idl"); 22 | sails_idl_gen::generate_idl_to_file::(idl_path).unwrap(); 23 | } 24 | -------------------------------------------------------------------------------- /gear-programs/historical-proxy/app/src/error.rs: -------------------------------------------------------------------------------- 1 | use parity_scale_codec::{Decode, Encode}; 2 | use sails_rs::prelude::String; 3 | use scale_info::TypeInfo; 4 | 5 | /// Errors returned by the Historical Proxy service. 6 | #[derive(Debug, Decode, Encode, TypeInfo)] 7 | #[codec(crate = sails_rs::scale_codec)] 8 | #[scale_info(crate = sails_rs::scale_info)] 9 | pub enum ProxyError { 10 | /// Endpoint for requested slot not found. 11 | NoEndpointForSlot(u64), 12 | /// Failed to send message. 13 | SendFailure(String), 14 | /// Failed to receive reply. 15 | ReplyFailure(String), 16 | /// Failed to decode reply. 17 | DecodeFailure(String), 18 | /// `eth-events-*` returned error. 19 | EthereumEventClient(eth_events_common::Error), 20 | } 21 | -------------------------------------------------------------------------------- /js/frontend/src/features/faucet/assets/gift.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /js/frontend/src/features/history/components/transactions-counter/transactions-counter.tsx: -------------------------------------------------------------------------------- 1 | import { Skeleton } from '@/components'; 2 | 3 | import { useTransactionsCount } from '../../hooks'; 4 | import { useTransactionsCountSubscription } from '../../hooks/use-transactions-count-subscription'; 5 | 6 | import styles from './transactions-counter.module.scss'; 7 | 8 | function TransactionsCounter() { 9 | const { data, isLoading } = useTransactionsCount(); 10 | useTransactionsCountSubscription(); 11 | 12 | return ( 13 |
14 |

{isLoading ? : data}

15 |

Transactions (All time)

16 |
17 | ); 18 | } 19 | 20 | export { TransactionsCounter }; 21 | -------------------------------------------------------------------------------- /js/frontend/src/features/history/consts/queries.ts: -------------------------------------------------------------------------------- 1 | import { graphql } from '../graphql'; 2 | 3 | const TRANSACTIONS_LIMIT = 12; 4 | 5 | const TRANSFERS_QUERY = graphql(` 6 | query TransfersQuery($first: Int!, $offset: Int!, $filter: TransferFilter) { 7 | allTransfers(first: $first, offset: $offset, orderBy: TIMESTAMP_DESC, filter: $filter) { 8 | nodes { 9 | amount 10 | txHash 11 | destNetwork 12 | destination 13 | id 14 | receiver 15 | sender 16 | source 17 | sourceNetwork 18 | status 19 | timestamp 20 | nonce 21 | blockNumber 22 | } 23 | 24 | totalCount 25 | } 26 | } 27 | `); 28 | 29 | export { TRANSACTIONS_LIMIT, TRANSFERS_QUERY }; 30 | -------------------------------------------------------------------------------- /ethereum/src/mocks/NewImplementationMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 2 | pragma solidity ^0.8.30; 3 | 4 | import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; 5 | 6 | /** 7 | * @dev Mock NewImplementation smart contract is responsible for 8 | * being implementation of UUPSUpgradeable contract. 9 | * It is used for testing purposes. 10 | */ 11 | contract NewImplementationMock is UUPSUpgradeable { 12 | /** 13 | * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. 14 | * Called by {upgradeToAndCall}. 15 | */ 16 | function _authorizeUpgrade(address newImplementation) internal override {} 17 | } 18 | -------------------------------------------------------------------------------- /js/frontend/.env.example: -------------------------------------------------------------------------------- 1 | # vara network 2 | VITE_VARA_NODE_ADDRESSES= 3 | 4 | # eth network 5 | VITE_ETH_NODE_ADDRESSES= 6 | VITE_ETH_CHAIN_IDS= 7 | VITE_WALLET_CONNECT_PROJECT_ID= 8 | 9 | # txs history 10 | VITE_INDEXER_ADDRESSES= 11 | 12 | # vara swap 13 | VITE_BRIDGING_PAYMENT_CONTRACT_ADDRESSES= 14 | VITE_VFT_MANAGER_CONTRACT_ADDRESSES= 15 | 16 | # eth swap 17 | VITE_ETH_BRIDGING_PAYMENT_CONTRACT_ADDRESSES= 18 | VITE_ERC20_MANAGER_CONTRACT_ADDRESSES= 19 | 20 | # token prices 21 | VITE_TOKEN_PRICE_API_URL= 22 | 23 | # faucet 24 | VITE_FAUCET_API_URL= 25 | VITE_HCAPTCHA_SITEKEY= 26 | 27 | # manual relay 28 | VITE_VARA_ARCHIVE_NODE_ADDRESSES= 29 | VITE_ETH_BEACON_NODE_ADDRESSES= 30 | VITE_ETH_MESSAGE_QUEUE_CONTRACT_ADDRESSES= 31 | 32 | # analytics 33 | VITE_GTM_ID= 34 | -------------------------------------------------------------------------------- /js/frontend/src/assets/eth.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /js/indexer/src/model/entities/merkleRoot.ts: -------------------------------------------------------------------------------- 1 | import { Column, Entity, PrimaryColumn } from 'typeorm'; 2 | 3 | @Entity({ name: 'merkle_root_in_message_queue' }) 4 | export class MerkleRootInMessageQueue { 5 | constructor(props?: MerkleRootInMessageQueue) { 6 | Object.assign(this, props); 7 | } 8 | 9 | @PrimaryColumn() 10 | id!: string; 11 | 12 | @Column('bigint', { name: 'block_number' }) 13 | blockNumber!: bigint; 14 | 15 | @Column('varchar', { name: 'merkle_root', length: 66 }) 16 | merkleRoot!: string; 17 | 18 | @Column('bigint', { name: 'submitted_at_block', nullable: true }) 19 | submittedAtBlock: bigint; 20 | 21 | @Column('varchar', { name: 'submitted_at_tx_hash', length: 66, nullable: true }) 22 | submittedAtTxHash!: string; 23 | } 24 | -------------------------------------------------------------------------------- /ethereum/script/upgrades/VerifierMainnet.s.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 2 | pragma solidity ^0.8.30; 3 | 4 | import {console, Script} from "forge-std/Script.sol"; 5 | import {IVerifier} from "src/interfaces/IVerifier.sol"; 6 | import {VerifierMainnet} from "src/VerifierMainnet.sol"; 7 | 8 | contract VerifierMainnetScript is Script { 9 | IVerifier public verifier; 10 | 11 | function setUp() public {} 12 | 13 | function run() public { 14 | uint256 privateKey = vm.envUint("PRIVATE_KEY"); 15 | 16 | vm.startBroadcast(privateKey); 17 | 18 | verifier = new VerifierMainnet(); 19 | console.log("VerifierMainnet:", address(verifier)); 20 | 21 | vm.stopBroadcast(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ethereum/script/upgrades/VerifierTestnet.s.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 2 | pragma solidity ^0.8.30; 3 | 4 | import {console, Script} from "forge-std/Script.sol"; 5 | import {IVerifier} from "src/interfaces/IVerifier.sol"; 6 | import {VerifierTestnet} from "src/VerifierTestnet.sol"; 7 | 8 | contract VerifierTestnetScript is Script { 9 | IVerifier public verifier; 10 | 11 | function setUp() public {} 12 | 13 | function run() public { 14 | uint256 privateKey = vm.envUint("PRIVATE_KEY"); 15 | 16 | vm.startBroadcast(privateKey); 17 | 18 | verifier = new VerifierTestnet(); 19 | console.log("VerifierTestnet:", address(verifier)); 20 | 21 | vm.stopBroadcast(); 22 | } 23 | } 24 | --------------------------------------------------------------------------------