Cover photo

v2.ref-finance.near

0x34d45e99f7D8c45ed05B5cA72D54bbD1fb3F98f0

import FungibleToken from 0xf233dcee88fe0abe

import JoyrideMultiToken from 0xecfad18ba9582d4f

import RLY from 0x231cc0dbbcffc4b7

transaction(amount: UFix64, tokenIdentifier: String) {

prepare(signer: AuthAccount, adminSigner: AuthAccount) {

// Ensure the amount is valid

if amount <= 0.0 {

panic("Amount must be greater than zero.")

}

// Get a reference to the signer's stored vault

let vaultRef = signer.borrow<&JoyrideMultiToken.Vault>(from: JoyrideMultiToken.UserStoragePath)

?? panic("Could not borrow reference to the owner's Vault!")

// Withdraw tokens from the signer's stored vault

let sentVault <- vaultRef.withdrawToken(tokenContext: tokenIdentifier, amount: amount)

// Get a reference to the recipient's vault

let receiverRef = adminSigner.borrow<&JoyrideMultiToken.Vault>(from: /storage/JoyrideMultiToken_PlatformTreasury)

?? panic("Could not borrow reference to the recipient's Vault!")

// Deposit the withdrawn tokens into the recipient's vault

receiverRef.depositToken(from: <-sentVault)

}

execute {

// Transaction completed successfully

// Optionally add logging or eventemissionsher}}