Skip to content

sync evm token support to main #84

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

Closed
wants to merge 82 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
71336e7
Allow reg token with existing implementation code.
yarkinwho Jun 26, 2024
1dc3c43
Add missing tests.
yarkinwho Jun 26, 2024
caf0ae4
Make the new action name shorter as it was 13 characters.
yarkinwho Jun 28, 2024
2e1a84f
Fix test.
yarkinwho Jun 28, 2024
09b75e4
Preliminary implementation.
yarkinwho Jul 1, 2024
78b8e69
Add modification notification to comply with GPL.
yarkinwho Jul 2, 2024
cae6929
Add some initial tests and missing functions.
yarkinwho Jul 2, 2024
b78fb83
Merge pull request #1 from exsat-network/yarkin/reg_token_with_code
yarkinwho Jul 2, 2024
ab3025e
Missing changes.
yarkinwho Jul 2, 2024
83d0aa7
Merge branch 'main' into yarkin/evmutil
yarkinwho Jul 2, 2024
7976ad8
Make evmutil tests using BTC as native token.
yarkinwho Jul 2, 2024
9005d03
Cleanup and add a view function for pending funds in stake_helper
yarkinwho Jul 4, 2024
6c4c888
Cleanup code
yarkinwho Jul 4, 2024
3084131
Minor fixes and add tests for synchronizer reward claim action.
yarkinwho Jul 5, 2024
e53ad2b
Update to use new API from endrmng
yarkinwho Jul 9, 2024
0efd2dc
Use singleton instead of table to store helper contract address.
yarkinwho Jul 9, 2024
08c0199
Update poolreg API. No functionality change expected.
yarkinwho Jul 9, 2024
577578d
More tests.
yarkinwho Jul 10, 2024
fa52225
Remove unused ricardian file.
yarkinwho Jul 10, 2024
ede279e
More tests.
yarkinwho Jul 10, 2024
573410a
Clean up code. No functionality change expected.
yarkinwho Jul 10, 2024
6cfa2e5
Add comments
yarkinwho Jul 10, 2024
c439c9c
Allow erc2o contract to upgrade default ERC20 contract implementation.
yarkinwho Jul 12, 2024
f1e25db
ERC20 contract update for exsat.
yarkinwho Jul 12, 2024
507f5e2
Relax limit on trasfer to the same level of erc2o.
yarkinwho Jul 12, 2024
b0af679
Allow evmutil to upgrade default stake implementation.
yarkinwho Jul 12, 2024
ac0cf59
Revert "ERC20 contract update for exsat."
yarkinwho Jul 12, 2024
938bef8
Temporary solution to make test pass. Need fix later.
yarkinwho Jul 12, 2024
8e1fb87
Add support for vdrclaim
yarkinwho Jul 15, 2024
06e5139
Get evmAddress, linkedEOS Address and linkedEOSAccountName from global
yarkinwho Jul 15, 2024
736dca8
Fix CICD
yarkinwho Jul 15, 2024
5cd6a3f
Passing in linkedEOSAddress and evmAddress during initialization for
yarkinwho Jul 16, 2024
26e06b4
Passing in linkedEOSAddress and evmAddress during initialization for
yarkinwho Jul 16, 2024
4509df6
Rename sync_reward_helper
yarkinwho Jul 16, 2024
a8493fb
Fix minor bug.
yarkinwho Jul 16, 2024
f04f3e8
allow upgrade deployed staking helper.
yarkinwho Jul 17, 2024
93e2222
Add events for staking helper.
yarkinwho Jul 17, 2024
58f927e
Improve getting pending fund logic.
yarkinwho Jul 20, 2024
8add202
Add creditcall to reward_helper
yarkinwho Jul 20, 2024
be21a2f
Strip comments before compiling for solidity contracts to avoid hitting
yarkinwho Jul 21, 2024
e5c5252
Update README
yarkinwho Jul 21, 2024
b8f8271
Merge pull request #2 from exsat-network/yarkin/evmutil
yarkinwho Jul 21, 2024
5e4c37d
Add more functions to support claim and list pending funds from
yarkinwho Jul 21, 2024
c933343
Merge pull request #3 from exsat-network/yarkin/additional_evmutil
yarkinwho Jul 21, 2024
79503dc
Merge remote-tracking branch 'upstream/release/0.2' into yarkin/merge…
yarkinwho Nov 27, 2024
f0572a0
Adopt to spring testers
yarkinwho Nov 27, 2024
326ffb3
Merge pull request #8 from exsat-network/yarkin/merge-upstream
yarkinwho Nov 28, 2024
f91388a
Update StakerHelper
frankoslive Nov 26, 2024
b895dbf
debug
frankoslive Nov 28, 2024
5575887
debug
frankoslive Nov 28, 2024
69c8bc4
Add test cases and perform testing.
frankoslive Dec 4, 2024
d2ae8cf
Add test cases and perform testing.
frankoslive Dec 5, 2024
016f67d
Add test cases and perform testing.
frankoslive Dec 5, 2024
9aee63a
deploy new stakeHelper implement
frankoslive Dec 6, 2024
34b2f9a
optimize btc transfer
frankoslive Dec 7, 2024
561f742
optimize btc transfer
frankoslive Dec 7, 2024
f8e25f0
optimize btc transfer
frankoslive Dec 8, 2024
1f0ae5c
optimize btc transfer
frankoslive Dec 8, 2024
a8612c5
optimize btc transfer
frankoslive Dec 9, 2024
f67d434
optimize unit test
frankoslive Dec 9, 2024
1e6793b
optimize btc transfer
frankoslive Dec 12, 2024
c872e88
fix pendingFunds result error
frankoslive Dec 16, 2024
4b560cb
Merge remote-tracking branch 'origin/frank/refactor-stake' into frank…
frankoslive Dec 16, 2024
a5197b8
optimize events
frankoslive Dec 18, 2024
9c4d952
optimize events
frankoslive Dec 19, 2024
cdf26b2
Modify stakeImpl to have an auto-incrementing primary key.
frankoslive Dec 19, 2024
29372f3
optimize primary key
frankoslive Dec 27, 2024
3a30c20
optimize transfer
frankoslive Dec 27, 2024
1f88f53
optimize auto primary key
frankoslive Dec 31, 2024
82a7c6d
Merge pull request #9 from exsat-network/frank/refactor-stake
yarkinwho Jan 2, 2025
1d6b134
fix bugs
frankoslive Jan 14, 2025
dff3646
Merge pull request #11 from exsat-network/frank/fix-bugs
yarkinwho Jan 15, 2025
9d467b3
Preliminary support for xsat and btc deposit.
yarkinwho Jan 15, 2025
1696a24
Merge branch 'main' into yarkin/new_staking_logic
yarkinwho Jan 15, 2025
af4731c
fix update and add some tests
yarkinwho Jan 20, 2025
8cfcab2
Add support for evmclaim2
yarkinwho Jan 22, 2025
55ee314
Merge pull request #12 from exsat-network/yarkin/new_staking_logic
yarkinwho Feb 10, 2025
b9e3cf7
Remove evmutil codes.
yarkinwho Feb 10, 2025
d0f14ab
update readme
yarkinwho Feb 10, 2025
1798bc7
Remove more unused files
yarkinwho Feb 10, 2025
f46af41
Merge pull request #13 from exsat-network/yarkin/remove_evmutil
yarkinwho Feb 12, 2025
162c639
Merge branch 'main' of https://github.com/eosnetworkfoundation/evm-br…
taokayan Apr 9, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,12 @@ jobs:
container: ${{fromJSON(needs.d.outputs.p)[matrix.platform].image}}

steps:
- name: Checkout evm-bridge-contracts
- name: Checkout exsat-evm-bridge-contracts
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: 'recursive'
path: evm-bridge-contracts
path: exsat-evm-bridge-contracts

- name: Download CDT
uses: AntelopeIO/asset-artifact-download-action@v3
Expand Down Expand Up @@ -179,7 +179,7 @@ jobs:

- name: Build EVM Bridge Contracts
run: |
pushd evm-bridge-contracts
pushd exsat-evm-bridge-contracts
cmake -B build -Deosevm_DIR=${{ steps.evm-contract.outputs.EVM_CONTRACT }}
cmake --build build -- -j
tar -pc build | zstd --long -T0 -9 > build.tar.zst
Expand All @@ -188,7 +188,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: builddir
path: evm-bridge-contracts/build.tar.zst
path: exsat-evm-bridge-contracts/build.tar.zst
compression-level: 0

- name: EVM Bridge Contracts Tests
Expand Down
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# EOS EVM Bridge Contracts
# Exsat EVM trustless bridge

This repository contains the Solidity and Antelope contracts needed to support advanced functionality of the trustless bridge of EOS EVM.
**The contracts for staking and claiming rewards have been moved to https://github.com/exsat-network/evmutil-contracts.**
**This repository now only contains the code for the trustless bridge for ERC20 tokens.**

This repository contains the Solidity and Antelope contracts needed to support the trustless bridges.

Those contracts (both within `solidity_contracts` and `antelope_contracts`) enable communication and tokens moves between the EVM and Native environments.

The `erc20` contracts (both within `solidity_contracts` and `antelope_contracts`) enable tokens to be moved between the EOS EVM and EOS Native environments across the trustless bridge of EOS EVM. On the EOS EVM side, the tokens are managed by an ERC-20 compatible token contract that is automatically deployed to EOS EVM and managed by the Antelope `erc20` contract. On the EOS Native side, the Antelope `erc20` contract supports any tokens that follow the common interface established by the [`eosio.token` reference contract](https://github.com/AntelopeIO/reference-contracts/tree/main/contracts/eosio.token); specifically, the token contract deployed on EOS Native must satisfy the interface for the `transfer` action captured in [this header file](antelope_contracts/contracts/erc20/include/erc20/eosio.token.hpp) and its behavior should follow the expectations set in the `eosio.token` reference contract.
## Dependencies

- CMake 3.16 or later
Expand All @@ -12,9 +16,9 @@ The `erc20` contracts (both within `solidity_contracts` and `antelope_contracts`
+ Used to compile the .sol files.
+ We chose to use solcjs because it is more actively maintained than the solc available from the package manager.
* First install node.js and npm.
* Then install solcjs: `npm install -g solc@0.8.21`
+ Make sure to install version 0.8.21.
* Confirm with `solcjs --version`. You should get `0.8.21+commit.d9974bed.Emscripten.clang`
* Then install solcjs: `npm install -g solc`
+ Make sure to install at least version 0.8.21.
* Confirm with `solcjs --version`.
- Install `jq` used to compile solidity contracts
+ `apt-get install jq`
- Install `xxd` used to compile solidity contracts
Expand Down
2 changes: 1 addition & 1 deletion antelope_contracts/contracts/erc20/include/erc20/erc20.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,4 +178,4 @@ void regtokenwithcodebytes(eosio::name token_contract, const bytes& address_byt



} // namespace erc20
} // namespace erc20
8 changes: 2 additions & 6 deletions antelope_contracts/contracts/stubs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
set(SOURCES, "")

list(APPEND SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/stub_evm_runtime.cpp
)

add_contract( stub_evm_runtime stub_evm_runtime ${SOURCES} )
add_contract( stub_evm_runtime stub_evm_runtime stub_evm_runtime.cpp )
target_include_directories( stub_evm_runtime PUBLIC )

target_compile_options(stub_evm_runtime PUBLIC --no-missing-ricardian-clause)

46 changes: 45 additions & 1 deletion solidity_contracts/compile_tools/compile_solidity_contract.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,51 @@ set -o pipefail
# 3 solcjs --starndard-json has some bugs (https://github.com/ethereum/solc-js/issues/460) so we can only use "content" as input.
# 4 To copy the source code into the json file, we have to escape \\ \" \t \n. (Ignore \b \r \f as we shouldn't have them in sol file)
tmpfile=$(mktemp)
cat "$SOLIDITY_SOURCE_FILE_PATH" \
awk 'BEGIN {
found=0;
}

{
spos=index($0,"/*");
epos=index($0,"*/");

if(spos > 0 && epos ==0)
{
printf("%s\n",substr($0,1,spos-1));
found=1;
}
else if(spos == 0 && epos >0)
{
found=0;
if(length($0) != epos+1)
{
printf("%s\n",substr($0,epos+2));
}
}
else if(spos > 0 && epos > 0)
{
printf("%s %s\n",substr($0,1,spos-1),substr($0,epos+2));
}
else if(found==0)
{
cpp_comment=index($0,"//");
if(cpp_comment == 0)
{
print;
}
else
{
printf("%s\n",substr($0,1,cpp_comment-1));
}
}
}

END {
if(found==1)
{
print "there is unmatched comment"
}
}' "$SOLIDITY_SOURCE_FILE_PATH" \
| awk -v token="__CONTRACT_CONTENT" '
BEGIN {
RS = "\0" # Set record separator to null to read the whole input
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"settings":
{
"optimizer": {
"enabled": false,
"enabled": true,
"runs": 200
},
"evmVersion": "byzantium",
Expand Down
Loading