Hi all,
I’m recently studying FUSD contract, and I found some transactions are missing from FlowScan. So I’m wondering if it’s me who misunderstood the contract or it’s FlowScan misses transactions.
Would really appreciate if anyone could help look into this
Here is my finding:
As I see from here, FUSD contract is deployed to account 0x3c5959b568896393 on Mainnet
https://docs.onflow.org/fusd/transactions/
Then if we check all transactions under account 0x3c5959b568896393, we can see this:
https://flowscan.org/account/0x3c5959b568896393
The first 3 transactions are for deploying contract, then the following 2 transactions are for adding new key pair, and the last transaction is for giving another account the capability to mint FUSD.
As we can see from the transaction, the capability is given to account 0x71c901f39f743871.
execute {
// This is the account that the capability will be given to
let minterAccount = getAccount(0x71c901f39f743871)
let capabilityReceiver = minterAccount.getCapability
<&FUSD.MinterProxy{FUSD.MinterProxyPublic}>
(FUSD.MinterProxyPublicPath)!
.borrow() ?? panic("Could not borrow capability receiver reference")
capabilityReceiver.setMinterCapability(cap: self.minterCapability)
}
As we see from the transaction, it borrows a capability from account 0x71c901f39f743871, so there should be a corresponding transaction sent by account 0x71c901f39f743871 which is used to create the resource and make the capability.
There should one transaction like this sent by 0x71c901f39f743871
import FUSD from 0x3c5959b568896393
transaction {
prepare(adminAccount: AuthAccount) {
let minter_proxy <- FUSD.createMinterProxy()
adminAccount.save(<- minter_proxy, to: FUSD.MinterProxyStoragePath)
adminAccount.link<&FUSD.MinterProxy{FUSD.MinterProxyPublic}>(
FUSD.MinterProxyPublicPath,
target: FUSD.MinterProxyStoragePath
) ?? panic("Could not link minter proxy")
}
}
But if we check all transactions under 0x71c901f39f743871 on FlowScan, there is no such transaction.
https://flowscan.org/account/0x71c901f39f743871
The first successful transaction is already “minting FUSD and sent to the recipient”
https://flowscan.org/transaction/93f02808e31248f2431d54067e754f706498182eaabdf3cbac73588f5b18f105
Is the transaction indeed missing from FlowScan?
Thanks a lot!
/Guisong