-
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.
- Loading branch information
1 parent
efd99b1
commit 34fa385
Showing
42 changed files
with
91 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,7 @@ | ||
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) | ||
return EVM.EVMAddress(bytes: bytes.toConstantSized<[UInt8; 20]>()) | ||
} |
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) | ||
) | ||
} |
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,11 +1,10 @@ | ||
import "EVM" | ||
|
||
import "EVMUtils" | ||
import "FlowEVMBridgeUtils" | ||
|
||
access(all) | ||
fun main(evmAddressHex: String): String { | ||
return FlowEVMBridgeUtils.deriveBridgedNFTContractName( | ||
from: EVMUtils.getEVMAddressFromHexString(address: evmAddressHex) ?? panic("Could not parse EVM address from hex string") | ||
from: EVM.addressFromString(evmAddressHex) | ||
) | ||
} |
Oops, something went wrong.