-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ETH connector #59
Merged
Merged
ETH connector #59
Changes from 109 commits
Commits
Show all changes
119 commits
Select commit
Hold shift + click to select a range
98b302a
Added prover & extended types
mrLSD 97a3759
Mode Borsh args from types to parameters
mrLSD a889328
Merge branch 'master' of github.com:aurora-is-near/aurora-engine into…
mrLSD 25154f0
Added fungible tokens
mrLSD a0942a2
Added eth-connector
mrLSD 5876814
Modify assert for fee
mrLSD facc786
Fix formatting
mrLSD b055a54
Extend eth-conenctor with EVM token logic
mrLSD eb9e361
Changed eth-connector deposit logic
mrLSD fcc1332
Added changes for ETH deposit/withdraw and Engine changes
mrLSD 978474b
Mint ETH-tokens
mrLSD 041879e
Added: transfer_eth
mrLSD b5ffb23
ETH withdraw basic method
mrLSD a7e73f4
eth-withdraw validation structure & modified Deposit-eth fields
mrLSD 45a5ca9
eth transfer and withdraw logic
mrLSD 676a86c
eip712 message verifier - started encoding
mrLSD e345d71
added encode-packed
mrLSD de7f36d
virefy EIP712 message for withdraw
mrLSD f1f6479
Changed EIP712 message fields
mrLSD 944b6e2
Modify logs for EIP712 messages
mrLSD 1201a39
Test EIP712
mrLSD 11dec10
Tests EIP712
mrLSD 89f572c
Integration tests for encode_withdraw_eip712
mrLSD d6830ea
Integration tests for encode_withdraw_eip712
mrLSD dd1f8e1
EIP712-Withdraw: improvements and fixes.
sept-en 96b3c0e
Extend tests for eth-connector
mrLSD 348e5cc
Merge branch 'evm-deposit-withdraw' of github.com:aurora-is-near/auro…
mrLSD 80f033b
eth-connector test deposit & balance & total_supply
mrLSD 07251fd
Imporved tests
mrLSD 2de5af8
FT tests
mrLSD e71d52a
Fixed verify_transfer_eip712
mrLSD 09b79c1
Change test_withdraw_near
mrLSD f2e1f11
Tests for: ft_transfer, ft_transfer_call
mrLSD 356ad42
test_eth_deposit_balance_total_supply
mrLSD 6cae502
test and ifx: deposit_eth, withdraw_near
mrLSD d920662
References in fungible token (#29)
birchmd 27f90ef
Fix: hide logging behind feature flag
birchmd 3b8f0d5
Merge branch 'evm-deposit-withdraw' into improved-evm-token-logic
mrLSD 1074daf
Remove eth-conenctor transfer methods and deposit for new design
mrLSD e2f3746
Integrate the ETH connector. (#24)
mrLSD 5d26090
Completed Deposit logic
mrLSD 628dfd8
Merge branch 'eth-connector' of github.com:aurora-is-near/aurora-engi…
mrLSD 8b8043c
Fix clippy; added comments; improved ft_transfer_call
mrLSD 41011e9
Extend external functions for eth-connector
mrLSD a4c1cc1
Added deploy_evm_token
mrLSD afb5291
Added ft_on_transfer logic
mrLSD a7b5d45
Changed ft_on_transfer & remove json depends
mrLSD 886c7f9
Changed deposit logic and fixed transfers
mrLSD 402223c
Added register relayer
mrLSD 6c100d0
Added message coder for ft_transfer_call
mrLSD 4217a5a
ft_on_transfer - added logic for erc20
mrLSD 919f704
Impoved ft_on_transfer
mrLSD a662f50
ft_on_transfer: call erc20 contract adn send fee to Relayer. Added logs
mrLSD 909b295
eth-connector: Removed unsued methods
mrLSD a0a02b1
tests: deposit & fixed init test
mrLSD c056e59
tests: depoist, withdraw
mrLSD 9eac293
tests: fix test_withdraw_near
mrLSD 253fb11
Eth-connector: never skip bridge call.
sept-en 5b46752
Tests: fix ft_transfer_call
mrLSD 1148981
ft_transfer_call - changed gas amountr
mrLSD fd7f31c
Fixed: test_eth_deposit_balance_total_supply, test_ft_transfer
mrLSD bae83f0
Merge branch 'improved-evm-token-logic' of github.com:aurora-is-near/…
mrLSD e97e7a8
Added: test_ft_transfer_call_near_eth
mrLSD f3f8e22
Clippy fix
mrLSD 6bc6d3e
Added test_ft_transfer_call_erc20
mrLSD e98cd2b
Added test_ft_transfer_call_erc20
mrLSD da067eb
tests: ft_transfer_call for ERC20 changes
mrLSD 95c80ff
Fix finish_deposit - promise flow when failed for ft_transfer_call
mrLSD 8fbb523
added: test_deposit_with_same_proof
mrLSD cdf2e84
Improved EVM token master branch update (#50)
joshuajbouw 5a0e427
Update src/connector.rs misspel
mrLSD 79602e5
Update src/connector.rs change constants error
mrLSD d1cf4d7
Changed withdraw args
mrLSD 8db04bc
Improved ETH connector logic (#36)
mrLSD 81f935e
Merge branch 'impr2' into eth-connector
mrLSD 0617912
Merge branch 'master' of github.com:aurora-is-near/aurora-engine into…
mrLSD 9e4cbe5
Mint fee at ft_on_transfer for special case - self transfer
mrLSD 61ae593
Fix tests
mrLSD c64d81a
Added check for fail promise result
mrLSD a2f7dd7
Remove ERC20-related functionality. Typo fixes.
sept-en 8812294
Typo and comment fixes.
sept-en ee4add9
EthConnector: rename `new()` to `get_instance()`.
sept-en 4a5624b
Fixed save contract and changed key for storage
mrLSD 805971a
Merge branch 'master' of github.com:aurora-is-near/aurora-engine into…
mrLSD 0df9382
Added doc for eth-connector, extended payable methods
mrLSD a9837cc
Make file changes, typo fix
mrLSD d14d045
Removed logs: withdraw. Fixed Makefile & tests
mrLSD 8cfb9c5
Changed key-generation for eth-connector & fungible token
mrLSD 5cb842d
Changed github action for tests
mrLSD 530163c
Fix git action for tests
mrLSD 46b1793
Fix git action for tests
mrLSD b9bb3ca
Merge branch 'master' of github.com:aurora-is-near/aurora-engine into…
mrLSD 6a88507
return previous version test_deposit_with_same_proof
mrLSD e99e928
Extend test_withdraw_near
mrLSD c7b5579
Merge remote-tracking branch 'upstream/master' into eth-connector
joshuajbouw 85fec05
Return actual panic
joshuajbouw 735bd8c
Fix sanity tests in connector (#71)
birchmd 92e3a20
Merge branch 'master' of github.com:aurora-is-near/aurora-engine into…
mrLSD 05711e3
Merge branch 'master' of github.com:aurora-is-near/aurora-engine into…
mrLSD d50be39
Merge branch 'master' of github.com:aurora-is-near/aurora-engine into…
mrLSD 4a009af
Merge branch 'develop' of github.com:aurora-is-near/aurora-engine int…
mrLSD 87dfbf2
Precompiles: fix primise_create invocation
mrLSD 5b0e843
Fix ft_on_transfer relayer fee mint
mrLSD f2a24fe
Early checking for ft_transfer_call message data
mrLSD d7298dd
Changed finish_deposit_near - asserts before save Proof hash
mrLSD 3b3e2f2
Use storage::bytes_to_key in EthConnectorContract::get_contract_key
birchmd d7d902e
Added test_ft_transfer_call_without_relayer
mrLSD 19fa058
Added test_ft_transfer_call_fee_greater_than_amount
mrLSD f180a08
Added overflow check: ft_transfer_call
mrLSD 7fb4239
Eugene's Eth connector review (#97)
b4a5d1e
Fix tests for eth-connector
mrLSD edc8e1d
Eth-connector extended proof tests (#106)
mrLSD 92f877d
EthConnector: make AdminControlled and pausable (#88)
sept-en ef24c7f
Eth-Connector tests: improvements and minor refactoring. (#108)
sept-en 540ccb1
Eth-connector: merge `develop` branch (#109)
sept-en 29785ce
EthConnector: restrict connector init to owner. (#112)
sept-en f86197d
Add compilation feature for exit precompiles. (#111)
sept-en ab69d39
Eth-connector:add the way to upgrade contract data. (#113)
sept-en 60374b6
Merge branch 'develop' of https://github.com/aurora-is-near/aurora-en…
sept-en File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
CARGO = cargo | ||
NEAR = near | ||
FEATURES = contract | ||
FEATURES = contract,log | ||
|
||
ifeq ($(evm-bully),yes) | ||
FEATURES := $(FEATURES),evm_bully | ||
|
@@ -15,6 +15,7 @@ release.wasm: target/wasm32-unknown-unknown/release/aurora_engine.wasm | |
|
||
target/wasm32-unknown-unknown/release/aurora_engine.wasm: Cargo.toml Cargo.lock $(wildcard src/*.rs) | ||
RUSTFLAGS='-C link-arg=-s' $(CARGO) build --target wasm32-unknown-unknown --release --no-default-features --features=$(FEATURES) -Z avoid-dev-deps | ||
ls -l target/wasm32-unknown-unknown/release/aurora_engine.wasm | ||
|
||
debug: debug.wasm | ||
|
||
|
@@ -24,6 +25,11 @@ debug.wasm: target/wasm32-unknown-unknown/debug/aurora_engine.wasm | |
target/wasm32-unknown-unknown/debug/aurora_engine.wasm: Cargo.toml Cargo.lock $(wildcard src/*.rs) | ||
$(CARGO) build --target wasm32-unknown-unknown --no-default-features --features=$(FEATURES) -Z avoid-dev-deps | ||
|
||
test-build: | ||
RUSTFLAGS='-C link-arg=-s' $(CARGO) build --target wasm32-unknown-unknown --release --no-default-features --features=contract,integration-test -Z avoid-dev-deps | ||
ln -sf target/wasm32-unknown-unknown/release/aurora_engine.wasm release.wasm | ||
ls -l target/wasm32-unknown-unknown/release/aurora_engine.wasm | ||
|
||
.PHONY: all release debug | ||
|
||
deploy: release.wasm | ||
|
@@ -35,10 +41,10 @@ check-format: | |
$(CARGO) fmt -- --check | ||
|
||
check-clippy: | ||
$(CARGO) +nightly clippy --no-default-features --features=$(FEATURES) -- -D warnings | ||
$(CARGO) clippy --no-default-features --features=$(FEATURES) -- -D warnings | ||
Comment on lines
-38
to
+44
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
|
||
# test depends on release since `tests/test_upgrade.rs` includes `release.wasm` | ||
test: release | ||
test: test-build | ||
$(CARGO) test | ||
|
||
format: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# ETH connector | ||
|
||
## Build | ||
1. For production set in the Makefile | ||
``` | ||
FEATURES = contract | ||
``` | ||
1.1. For **development and testing** set in the Makefile | ||
``` | ||
FEATURES = contract,integration-test | ||
``` | ||
2. Build release: `$ make release` | ||
3. Run tests: `$ cargo test` | ||
4. Deploying process is common for Aurora itself. Please reference [README.md](../README.md) | ||
|
||
## Initialize eth-conenctor | ||
With `near-cli` run: | ||
``` | ||
$ near call <NEAR_ACC> new_eth_connector '{"prover_account": "<PROVER_NEAR_ACCOUNT>", "eth_custodian_address": "<ETH_ADDRESS>"}' --account-id <NEAR_ACC> | ||
|
||
``` | ||
|
||
## ETH connector specific methods | ||
* new_eth_connector (call once) | ||
* deposit (mutable) | ||
* withdraw (mutable, payable) | ||
* finish_deposit_near (private, mutable) | ||
* ft_total_supply (view) | ||
* ft_total_supply_near (view) | ||
* ft_total_supply_eth (view) | ||
* ft_balance_of (view) | ||
* ft_balance_of_eth (view) | ||
* ft_transfer (mutable, payable) | ||
* ft_resolve_transfer (private, mutable) | ||
* ft_transfer_call (mutable, payable) | ||
* ft_on_transfer (private, mutable) | ||
* storage_deposit (mutable) | ||
* storage_withdraw (mutable, payable) | ||
* storage_balance_of (view) | ||
|
||
## Ethereum specific flow | ||
Follow by [this instruction](https://github.com/aurora-is-near/eth-connector/blob/master/README.md). |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't be on by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a discussion about this on Slack.
Summary is: if something goes wrong in production there's basically no way to know what happened without logging and it's not that expensive to have it (@mrLSD measured it to be ~0.5 Tgas which is much much less than any operation currently).