-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #84 from onflow/remove-evm-utils
Remove EVMUtils & implementations
- Loading branch information
Showing
42 changed files
with
95 additions
and
234 deletions.
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
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,11 @@ | ||
import "EVM" | ||
|
||
import "EVMUtils" | ||
import "FlowEVMBridge" | ||
|
||
/// Returns the EVM address associated with the FlowEVMBridge | ||
/// | ||
/// @return The EVM address associated with the FlowEVMBridge's coordinating CadenceOwnedAccount | ||
/// | ||
access(all) fun main(): String { | ||
let address: EVM.EVMAddress = FlowEVMBridge.getBridgeCOAEVMAddress() | ||
return EVMUtils.getEVMAddressAsHexString(address: address) | ||
return FlowEVMBridge.getBridgeCOAEVMAddress().toString() | ||
} |
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,17 +1,11 @@ | ||
import "EVM" | ||
|
||
import "EVMUtils" | ||
|
||
/// Converts EVM address bytes into to a hex string | ||
/// | ||
access(all) fun main(bytes: [UInt8]): String? { | ||
let address = EVM.EVMAddress( | ||
bytes: [ | ||
bytes[0], bytes[1], bytes[2], bytes[3], bytes[4], | ||
bytes[5], bytes[6], bytes[7], bytes[8], bytes[9], | ||
bytes[10], bytes[11], bytes[12], bytes[13], bytes[14], | ||
bytes[15], bytes[16], bytes[17], bytes[18], bytes[19] | ||
] | ||
) | ||
return EVMUtils.getEVMAddressAsHexString(address: address) | ||
let constBytes = bytes.toConstantSized<[UInt8; 20]>() | ||
?? panic("Problem converting provided EVMAddress compatible byte array - check byte array contains 20 bytes") | ||
return EVM.EVMAddress( | ||
bytes: constBytes | ||
) | ||
} |
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,22 +1,19 @@ | ||
import "EVM" | ||
|
||
import "EVMUtils" | ||
import "FlowEVMBridgeUtils" | ||
|
||
/// Returns the balance of the owner (hex-encoded EVM address - minus 0x prefix) of a given ERC20 fungible token defined | ||
/// Returns the balance of the owner (hex-encoded EVM address) of a given ERC20 fungible token defined | ||
/// at the hex-encoded EVM contract address | ||
/// | ||
/// @param owner: The hex-encoded EVM address of the owner without the 0x prefix | ||
/// @param evmContractAddress: The hex-encoded EVM contract address of the ERC20 contract without the 0x prefix | ||
/// @param owner: The hex-encoded EVM address of the owner | ||
/// @param evmContractAddress: The hex-encoded EVM contract address of the ERC20 contract | ||
/// | ||
/// @return The balance of the address, reverting if the given contract address does not implement the ERC20 method | ||
/// "balanceOf(address)(uint256)" | ||
/// | ||
access(all) fun main(owner: String, evmContractAddress: String): UInt256 { | ||
return FlowEVMBridgeUtils.balanceOf( | ||
owner: EVMUtils.getEVMAddressFromHexString(address: owner) | ||
?? panic("Invalid owner address"), | ||
evmContractAddress: EVMUtils.getEVMAddressFromHexString(address: evmContractAddress) | ||
?? panic("Invalid EVM contract address") | ||
owner: EVM.addressFromString(owner), | ||
evmContractAddress: EVM.addressFromString(evmContractAddress) | ||
) | ||
} |
Oops, something went wrong.