-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ERC-4337] Making UserOp generation compatible with different wallet … (
#3173) * [ERC-4337] Making UserOp generation compatible with different wallet implementations * Add init code * Update BarzTests.swift * update user op construction * Fix swift tests * remove old tests * fix issues related to the new ethereum proto size * update android tests * Update TestBarz.kt * Update TestBarz.kt * Update TestBarz.kt * Update TestBarz.kt * Update TestBarz.kt * disable unity build and fix some warnings * Fix android codegen Init check * commit missing files * Update TestBarz.kt * Update TestBarz.kt * Update TestBarz.kt * Update TestBarz.kt * Update Barz.cpp * Update TestBarz.kt * Update TestBarz.kt * Update TestBarz.kt * Update TestBarz.kt * Update TestBarz.kt --------- Co-authored-by: hewigovens <[email protected]>
- Loading branch information
1 parent
c0f2f84
commit 1240280
Showing
31 changed files
with
647 additions
and
1,352 deletions.
There are no files selected for viewing
155 changes: 133 additions & 22 deletions
155
android/app/src/androidTest/java/com/trustwallet/core/app/blockchains/ethereum/TestBarz.kt
Large diffs are not rendered by default.
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
231 changes: 0 additions & 231 deletions
231
...dTest/java/com/trustwallet/core/app/blockchains/ethereum/TestEthereumTransactionSigner.kt
Large diffs are not rendered by default.
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
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
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
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
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 was deleted.
Oops, something went wrong.
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright © 2017-2023 Trust Wallet. | ||
// | ||
// This file is part of Trust. The full Trust copyright notice, including | ||
// terms governing use, modification, and redistribution, is contained in the | ||
// file LICENSE at the root of the source code distribution tree. | ||
|
||
#include "ABI.h" | ||
#include "AddressChecksum.h" | ||
#include "EIP1014.h" | ||
#include "EIP1967.h" | ||
#include "Hash.h" | ||
#include "HexCoding.h" | ||
#include <iostream> | ||
|
||
namespace TW::Ethereum { | ||
|
||
using ParamBasePtr = std::shared_ptr<ABI::ParamBase>; | ||
using ParamCollection = std::vector<ParamBasePtr>; | ||
|
||
// https://github.com/eth-infinitism/account-abstraction/blob/develop/contracts/samples/SimpleAccount.sol#L57 | ||
Data getERC4337ExecuteBytecode(const Data& toAddress, const uint256_t& value, const Data& data) { | ||
auto executeFunc = ABI::Function("execute", ParamCollection{ | ||
std::make_shared<ABI::ParamAddress>(toAddress), | ||
std::make_shared<ABI::ParamUInt256>(value), | ||
std::make_shared<ABI::ParamByteArray>(data)}); | ||
Data executeFuncEncoded; | ||
executeFunc.encode(executeFuncEncoded); | ||
return executeFuncEncoded; | ||
} | ||
|
||
|
||
} // namespace TW::Ethereum |
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,16 @@ | ||
// Copyright © 2017-2023 Trust Wallet. | ||
// | ||
// This file is part of Trust. The full Trust copyright notice, including | ||
// terms governing use, modification, and redistribution, is contained in the | ||
// file LICENSE at the root of the source code distribution tree. | ||
|
||
#pragma once | ||
|
||
#include "Data.h" | ||
#include "uint256.h" | ||
|
||
namespace TW::Ethereum { | ||
|
||
Data getERC4337ExecuteBytecode(const Data& toAddress, const uint256_t& value, const Data& data); | ||
|
||
} |
Oops, something went wrong.