32 - Fund subscription - Link token Mock #3355
Unanswered
SiegfriedBz
asked this question in
Q&A
Replies: 1 comment 3 replies
-
Hello @SiegfriedBz, Your question is a reasonable one because if we are on a test net we should only use details but the reality is that we need an interface and contract address to interact with any contract deployed on any chain, so if the interface of the mock compile down to the interface of the real Link token contract on Sepolia we can use it and wrap the contract address of the contract deployed to sepolia in it to interact with it on the Sepolia chain, which is exactly what we did in the process you described. Please ask questions if anything is still confusing. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
in the
fundSubscription
function, if I m correct ?, we check if we are on the local Anvil chain withblock.chainid == LOCAL_CHAINID
Then, inside this block, we grab an instance of the
VRFCoordinatorV2_5Mock
mock contract to call thefundSubscription
function on itSo far so good
What I don t understand is, why, in the
else
statement, which meansblock.chainid =! LOCAL_CHAINID
, do we use a mock of the Link token ?As I understood, we use mocks when we are the local chain ?.. but here, we would be on a testnet isn t it ?
and if we are on a testnet, why not using the Link token contract deployed on this testnet instead of mocking it ?..
Thanks in advance !
Beta Was this translation helpful? Give feedback.
All reactions