Skip to content
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

Silo to silo transfers #225

Merged
merged 51 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
3e42c1b
Implement silo to silo transfers
karim-en Jul 21, 2023
1489933
Silo2Silo: Pass deposit amount on register token
karim-en Aug 8, 2023
be4dea6
Silo to silo tests (#226)
olga24912 Aug 10, 2023
c6f793f
Make `registerToken` trustless
karim-en Aug 11, 2023
9a43fc1
Fix integration tests project
karim-en Aug 14, 2023
86a8fce
Call without wNEAR transfer & minor code improvments
karim-en Aug 16, 2023
92a4995
Replace uint256 with u128
karim-en Aug 17, 2023
69796e7
Add UUPS proxy
karim-en Aug 17, 2023
301b031
Fix naming
karim-en Aug 17, 2023
2c64fdc
Add upgrade script & minor code improvments
karim-en Aug 17, 2023
e2eb56e
Fix tests
karim-en Aug 17, 2023
866c771
remove redundant values from libs and allow_paths
olga24912 Aug 24, 2023
44aeb36
Apply suggestions from code review
karim-en Sep 6, 2023
699e8a8
Check if the storage already registered
karim-en Sep 6, 2023
1ce0d4d
Minor code improvment
karim-en Sep 10, 2023
f87f955
Fix test
karim-en Sep 10, 2023
1e58cff
Use `ONE_NEAR`
karim-en Sep 10, 2023
68f3109
Fix variable naming
karim-en Sep 11, 2023
4bc4e99
Add more events & minor improvments
karim-en Sep 15, 2023
3dedaab
Withdraw: decrease the balance in main call
karim-en Sep 15, 2023
5c91b1c
Improve `withdrawCallback`
karim-en Sep 20, 2023
da5713c
Remove comment
karim-en Sep 20, 2023
7548ad3
Add `withdrawTo` function
karim-en Sep 20, 2023
312d8e7
Add pause/unpause logic
karim-en Sep 20, 2023
95a1b89
Emit event on initiating a ft transfer call
karim-en Sep 20, 2023
c752ebb
Remove apostrophe to fix git formating
karim-en Sep 21, 2023
f3fa4c2
Remove apostrophe to fix git formating
karim-en Sep 21, 2023
9b64b59
Add possibility to register recipients
karim-en Sep 25, 2023
b5ceaba
Fix test
karim-en Sep 25, 2023
8cece50
Add `sender` to the transfers events
karim-en Sep 25, 2023
5263f9e
Add `isRecipientStorageRegistered`
karim-en Sep 26, 2023
82c51e2
Index `nonce` instead of `receiverId`
karim-en Sep 27, 2023
1f44131
Add amount to the event
karim-en Sep 27, 2023
f73b503
Add support for native tokens
karim-en Sep 27, 2023
9f6e148
Update deploy script
karim-en Sep 27, 2023
5d58802
Merge branch 'master' into silo-to-silo
karim-en Oct 12, 2023
7803719
Update toolchain
karim-en Oct 12, 2023
d4d939d
Add extra check for attached value
karim-en Oct 12, 2023
c4b54bd
Silo-to-silo: extra tests (#229)
olga24912 Oct 12, 2023
7c9a946
Silo-to-silo: scripts for interaction with SiloToSilo contract (#230)
olga24912 Oct 12, 2023
abc94c9
Revert toolchain update
karim-en Oct 12, 2023
cb8ff91
Transfer wNEAR on storage deposit
karim-en Dec 11, 2023
4a0076d
Use proxy address from the config
karim-en Dec 12, 2023
bd9892b
Apply fmt
karim-en Dec 12, 2023
f6fc53a
Remove deprecated code
karim-en Dec 12, 2023
66042ba
Deploy on enpower silo
karim-en Dec 20, 2023
49aaa09
Fix chainId
karim-en Dec 21, 2023
ab1c436
Panic if the transfer failed
karim-en Jan 12, 2024
1cce40a
Upgrade on enpower silo
karim-en Jan 12, 2024
be85252
Re-upgrade contract on mainnet & enpower silo
karim-en Jan 12, 2024
aee049a
Fix withdraw test
karim-en Jan 12, 2024
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
14 changes: 14 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,17 @@ jobs:
- name: Test
run: |
make test-token-locker

test-silo-to-silo:
runs-on: self-hosted
name: Test silo-to-silo
steps:
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
- name: Clone the repository
uses: actions/checkout@v2
with:
submodules: recursive
- name: Test
run: |
make test-token-silo-to-silo
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "silo-to-silo/integration-tests/aurora-contracts-sdk"]
path = silo-to-silo/integration-tests/aurora-contracts-sdk
url = https://github.com/aurora-is-near/aurora-contracts-sdk.git
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@ test-token-locker:
cd token-locker && \
cargo test --all

test-token-silo-to-silo:
cd silo-to-silo && \
yarn && \
cd integration-tests && \
rustup target add wasm32-unknown-unknown && \
export RUSTFLAGS='-C link-arg=-s' && \
$(CARGO) build --target wasm32-unknown-unknown --release --manifest-path mock_token/Cargo.toml && \
cargo test --all --jobs 4 -- --test-threads 4

# <--
# For testing purposes only (can be removed at any moment)
no_icon: res/bridge_token_no_icon.wasm res/bridge_token_factory_no_icon.wasm
Expand Down
5 changes: 5 additions & 0 deletions silo-to-silo/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules/
artifacts/
cache/
.env
contracts/out/*
14 changes: 14 additions & 0 deletions silo-to-silo/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"overrides": [
{
"files": "*.sol",
"options": {
"printWidth": 120,
"tabWidth": 4,
"useTabs": false,
"singleQuote": false,
"bracketSpacing": false
}
}
]
}
7 changes: 7 additions & 0 deletions silo-to-silo/configs/aurora-testnet.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"siloAccountId": "aurora",
"nativeTokenAccountId": "aurora",
"auroraSdkAddress": "0x425cA8f218784ebE2df347E98c626094B63E7f30",
"auroraUtilsAddress": "0xc129336a6995F3b70A7139585403B82098260172",
karim-en marked this conversation as resolved.
Show resolved Hide resolved
"wNearAddress": "0x4861825E75ab14553E5aF711EbbE6873d369d146"
}
8 changes: 8 additions & 0 deletions silo-to-silo/contracts/foundry.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[profile.default]
src = 'src'
out = 'out'
libs = ['../node_modules', '../integration-tests/aurora-contracts-sdk/aurora-solidity-sdk/lib']
allow_paths = []
solc = "0.8.17"

# See more config options https://github.com/foundry-rs/foundry/tree/master/config
8 changes: 8 additions & 0 deletions silo-to-silo/contracts/src/IEvmErc20.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.17;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

interface IEvmErc20 is IERC20 {
function withdrawToNear(bytes memory recipient, uint256 amount) external;
}
Loading
Loading