Commit Graph

53 Commits

Author SHA1 Message Date
Drew 6c6b25ab2a add check for the zero address in storeGuardianSet
Change-Id: Ic3c5fce71f687d98380d39dc62923d9c6423e194
2022-09-15 10:39:39 -04:00
Kevin Peters cec5bc7528 ethereum: Added fork protection tests 2022-09-09 13:16:27 -05:00
Kevin Peters b1081d7d93 ethereum: Simplified forked chain check
No longer need to return uint16 max in chainId() for forked chains
2022-09-09 13:16:27 -05:00
Kevin Peters ae04a305f3 ethereum: fixed tests 2022-09-09 13:16:27 -05:00
Kevin Peters cacf054f0b ethereum: Added RecoverChainId Governance Message
Used to set the `chainId` and `evmChainId` for "bad-fork" chains
2022-09-09 13:16:27 -05:00
Kevin Peters 9d477e0585 ethereum: EVM fork protection
Added a `uint256 evmChainId` state variable to the Core, Token and NFT Bridge
contracts. `evmChainId` is compared to `block.chainid` in the `chainId`
function. When they don't match, a "bad fork" Chain ID is returned,
otherwise the Wormhole Chain ID is returned.
2022-09-09 13:16:27 -05:00
Evan Gray a58c5ae950 ethereum: remove wormhole from token name 2022-08-31 17:21:52 -04:00
justinschuldt d7b102df70 add EVM contract for batched VAA development 2022-08-15 08:41:40 -05:00
Csongor Kiss 3e051e97b6 ethereum: Init foundry project and add installer for native solc 2022-08-09 20:02:47 +01:00
Evan Gray 271076a7b5 eth: 1 conf in devnet 2022-07-15 14:36:46 -04:00
Csongor Kiss c453f4cf6d evm: Make finality a state variable 2022-06-28 21:31:23 +01:00
Csongor Kiss b6ea70fde0 evm: Add fromAddress to TransferWithPayload and remove fee 2022-06-21 22:35:49 -04:00
Jonathan Claudius 8875735581
Move quorum out of verifyVM (#1162)
* Move quorum out of verifyVM

* Add stub out to demonstrate sol-based tests

* Remove unnecessary import

* Neaten up the quorum conditional

* Another iteration on figuring out the test logic

* Fix indentation

* Refactor quorum and setup unit-test cases

* fix return naming

* More variable name clean up

* Move length check inside loop structure

* Fix condition by wrapping

* Fix syntax error

* fix type definition for testCases

* Drop inline struct usage for simple 2d array

* Fix logic in quorum check

* Make test public and fully qualify quorum

* Make wormhole.sol fail

* Specify where to store testCases

* Define array directly

* Fix syntax error on array definition

* Fix variable name

* Move back to memory-based variable

* Add remove qualified quorum call

* Get really direct on quorum tests

* Simplify quorum logic

* Add test for 19 guardians
2022-06-07 09:45:47 -04:00
Evan Gray 73e15db866 eth: token bridge transfer with payload 2022-05-11 21:24:36 -04:00
Jonathan Claudius 040eace4f7
Add to ethereum contract integration test coverage (#1053)
* Fix assert typos

* Restructure data field and add comments

* Move magic hex into named variables

* Add README items for running tests

* Add make test to README

* Show work on core string generation

* Add action transfer fee

* Add more VM integration test cases
2022-04-14 10:11:04 -04:00
Csongor Kiss 745d3db68d
Run ethereum tests on CI (#1028)
* Add makefile to run ethereum tests

* Run tests on CI

* single rm in make clean

Co-authored-by: Jeff Schroeder <jeffschroeder@computer.org>

* Fix WETH address in bridge test

Change-Id: Idd7455cc873d2db86c2ccc130bd673b065311e67

* Don't kill ganache-cli if already running

Instead error the test

* eth: omit mainnet stuff from ci

Co-authored-by: Csongor Kiss <ckiss@jumptrading.com>
Co-authored-by: Jeff Schroeder <jeffschroeder@computer.org>
Co-authored-by: Drew Sterioti <asterioti@jumptrading.com>
Co-authored-by: Evan Gray <battledingo@gmail.com>
2022-03-31 00:32:27 -04:00
valentin 6e87730aec add aproval tests 2022-03-18 13:14:32 +00:00
Evan Gray a3272dce4a remove pyth2wormhole 2022-03-07 10:23:34 -05:00
Stanisław Drozd 2ea41b8176
[WIP] Pr/drozdziak1/p2w batching/5e704f8b (#877)
* ethereum: p2w contract -> p2w emitter, fill in essential envs

Change-Id: I6fa9364a96738d2cc02ec829a31fedba0586d8e8

commit-id:0a56f1f8

* Add p2w-relay, a p2w-sdk integration test

commit-id:6bfab639

* p2w-sdk: Expand README

Change-Id: I17cb547d6aaddc240588923561c26d11a787df2e

commit-id:6ebd6a22

* p2w-sdk: don't build ETH contracts, only the types

Change-Id: I7cbd18328227700635d7688aa24a9671e8919fcd

commit-id:adf079f7

* p2w: configurability and sane envs

commit-id:f10fd90e

* Solitaire: Implement Option<T> support in structs

commit-id:31aa12d6

* bridge/governance.rs: Stop pestering about EMITTER_ADDRESS

commit-id:d5bd7234

* p2w-attest: price batching

This commit introduces support for multiple Pyth product/price pairs
per call. The initial maximum batch size is 5 and is enforced using a
`P2W_MAX_BATCH_SIZE` constant.

solana/pyth2wormhole/program:
* On-chain batching logic
* Batch message parsing logic

solana/pyth2wormhole/client:
* Off-chain batching logic - divides any number of symbols into
largest possible batches
* Use a multi-symbol config file instead of CLI arguments

third_party/pyth/p2w-sdk:
* Expose batch parsing logic

third_party/pyth/p2w-relay:
* Comment out target chain calls until ETH contract supports batching
* Test the batch parsing function

third_party/pyth/p2w_autoattest.py:
* Generate and use the symbol config file  with pyth2wormhole-client

third_party/pyth/pyth_publisher.py:
* Add a configurable number of mock Pyth symbols
* Adjust HTTP endpoint for multiple symbols

commit-id:73787a61

* p2w-attest: mention attestation size in batch

This commit ensures that no matter the attestation format, a batch
will never contain attestations of different sizes. This guarantee
enables forward compatibility by adding new constant-size fields at
the end of a batch at all times. An older implementation will simply
not consume the remaining newer values while respecting the stated
batch member alignment.

commit-id:210da230

* pyth2wormhole-client: use fresh blockhashes, harden batch errors

This commit makes sure we don't have to deal with expired transactions
due to stale blockhashes. The problem existed with larger symbol
configs as well as on Solana mainnet. Additionally, the attestation logic
now treats transaction errors as non-critical - a failure for a batch
does not prevent attestation attempts for batches farther in the queue

commit-id:5e704f8b
2022-02-23 19:12:16 +01:00
valentin 1226f85461 support tokens with transfer fees
Change-Id: Ib6ef2f1680ac845ef0f05c51047846c2633b0d4b
2021-10-29 16:55:05 +00:00
valentin ffcdc3f3f2 add token migration contract
Change-Id: I2bc3fb4d99f5a08452bc2defd3597ec7ad300523
2021-09-28 10:35:34 +00:00
valentin 46440b3bf9 nft: add special case for spl naming, update tests
Change-Id: Ifbe9eeaad5d5604d52d75fdac6b018e94afa9d75
2021-09-20 15:16:57 +00:00
valentin 7e2cf1f981 pyth data bridge target chain module for EVM
Change-Id: Ieaeed6374e72a5348e05c40bd25598b74061a9a0
2021-09-16 13:46:51 +00:00
Hendrik Hofstadt 6ff21f8d01 add ethereum NFT bridge
Change-Id: I5cc8cfe431f5f9b043adc7baf662760ffe9e7a35
2021-09-10 23:43:14 +00:00
Hendrik Hofstadt b0c95b85a6 update ethereum tests
This accounts for the token name suffix and tests updating of wrapped asset meta

Change-Id: I752cd43e899df949d31e8f8ef7d706ead41f4502
2021-09-01 14:13:18 +02:00
valentin 245409852f bridge: mint directly to recipient
Change-Id: Idfa06609c5b9982c885eaa14b402965514b2e143
2021-08-19 10:19:48 +00:00
valentin 45d22ce84f bridge: move evm state setup into a separate contract
Change-Id: Ibc790ba971be5144c0af65870d424c9c62b52039
2021-08-19 10:19:40 +00:00
valentin a055af1416 move EVM state setup into a seperate contract
Change-Id: Ie000dd042c4ebbd7084511d38d87a7555c5d8048
2021-08-19 10:19:26 +00:00
Hendrik Hofstadt bedc96d887 Add token bridge client for eth and solana
Change-Id: I0f9af0ffc606aed58579f167fadf80d1964360c8
2021-08-06 15:21:27 +00:00
valentin 51e00dc1bf tokenbridge: decimal shifting & max outstanding
Change-Id: Ia9f27f317fe08c1d8dbb9eaa60e53633acfdd381
2021-07-27 11:43:44 +00:00
valentin 14e892300c tokenbridge: implement new governance packet spec
Change-Id: Iee4b596b6a8ca9dfc9c6ee8c6188a4083a05edeb
2021-07-27 08:59:32 +00:00
valentin 2e6a93b643 ethereum token bridge on wormhole
Change-Id: Iab8d6f6aae6163d1c65f7d5a7395a943c62cdb0c
2021-07-21 14:11:58 +00:00
valentin 30a50938d7 remove persistency, return sequence, update tests
Change-Id: Ibdaa3f6443dcabe3a838bc25888bb9676b7e1d2d
2021-07-20 16:07:11 +02:00
Hendrik Hofstadt 227445cd76 Fix tests and add double hashing
Change-Id: I9676e8dd8d25f44c43ef10462493f20d1caff724
2021-07-20 13:43:21 +00:00
Hendrik Hofstadt f665fe4c7b Fix signature schema and use a single initial guardian in ETH
Change-Id: Ia1995df4ed8f86443cdd62acee7914ffc745d407
2021-07-02 10:48:54 +00:00
Hendrik Hofstadt e7ebf8dc1d Correctly verify sequence in ETH tests
Change-Id: Ic9a9fa5355362326a47d9d3742107ccaac6794d5
2021-06-30 13:13:31 +02:00
valentin 2be6f90314 remove payload length from vm
Change-Id: I89ae8530de8f43a2d2a1813d1d050413338b45d0
2021-06-28 13:45:45 +02:00
valentin 7032d6fba9 add sequence to vm
Change-Id: I0ec81979153c940a8d557ffdd67dec723c09f22c
2021-06-28 11:25:26 +00:00
valentin c3fa835196 ethereum generalized messaging & governance
Change-Id: I412111a10749050ca095458f2fcfe81ce0fe189c
2021-05-27 16:01:49 +02:00
Hendrik Hofstadt 3e88ed023e ethereum: properly realign transfer decimals, handle decimals on ETH transfers, don't allow same-chain transfers
Co-authored-by: Valentin von Albrecht <valentinvonalbrecht@yahoo.de>
2020-08-30 19:25:31 +02:00
Hendrik Hofstadt a2bd5fbb11 ethereum: truncate decimals to 9 2020-08-30 11:21:45 +02:00
Hendrik Hofstadt f6750a3762 all: consider decimals on wrapped assets, fix VAA posting, fix solana account parsing 2020-08-28 15:10:42 +02:00
Hendrik Hofstadt 8e6dc495dc bridge: remove VAA timeout
Closes #35
2020-08-28 08:49:46 +02:00
Hendrik Hofstadt 5b7b80dbe8 ethereum: add nonce to tests 2020-08-21 12:48:14 +02:00
Leo d1c86a0eaa bridge: use new eth devnet addresses and keygen 2020-08-19 17:38:55 +02:00
Hendrik Hofstadt 59449a30b3 Update VAA structure 2020-08-19 16:41:25 +02:00
Leo e548bbbee3 devnet: add send-lockups.js truffle script to generate test lockups 2020-08-17 16:31:48 +02:00
Leo f8b313cab8 ethereum: remove unused Schnorr references from tests 2020-08-16 01:54:49 +02:00
Hendrik Hofstadt 6e5a3fa118 Update ETH smart contract for new signature schema 2020-08-15 00:09:48 +02:00
Hendrik Hofstadt c2673c109a prevent old guardians from updating the set 2020-08-07 11:12:46 +02:00