-
Notifications
You must be signed in to change notification settings - Fork 10
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 #46 from m-Peter/setup-improvements
Setup improvements for running the Flow EVM Gateway
- Loading branch information
Showing
3 changed files
with
56 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import EVM from 0xf8d6e0586b0a20c7 // todo dynamically set | ||
import FungibleToken from 0xee82856bf20e2aa6 | ||
import FlowToken from 0x0ae53cb6e3f42a79 | ||
|
||
transaction(amount: UFix64) { | ||
let sentVault: @FlowToken.Vault | ||
let auth: auth(Storage) &Account | ||
|
||
prepare(signer: auth(Storage) &Account) { | ||
let vaultRef = signer.storage.borrow<auth(FungibleToken.Withdrawable) &FlowToken.Vault>( | ||
from: /storage/flowTokenVault | ||
) ?? panic("Could not borrow reference to the owner's Vault!") | ||
|
||
self.sentVault <- vaultRef.withdraw(amount: amount) as! @FlowToken.Vault | ||
self.auth = signer | ||
} | ||
|
||
execute { | ||
let account <- EVM.createBridgedAccount() | ||
log(account.address()) | ||
account.deposit(from: <-self.sentVault) | ||
|
||
log(account.balance().flow) | ||
self.auth.storage.save<@EVM.BridgedAccount>(<-account, to: StoragePath(identifier: "evm")!) | ||
} | ||
} |
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,18 @@ | ||
{ | ||
"contracts": {}, | ||
"networks": { | ||
"emulator": "127.0.0.1:3569", | ||
"testing": "127.0.0.1:3569" | ||
}, | ||
"accounts": { | ||
"emulator-account": { | ||
"address": "0xf8d6e0586b0a20c7", | ||
"key": "2619878f0e2ff438d17835c2a4561cb87b4d24d72d12ec34569acd0dd4af7c21" | ||
} | ||
}, | ||
"deployments": { | ||
"emulator": { | ||
"emulator-account": [] | ||
} | ||
} | ||
} |