Open peterduhon opened 2 weeks ago
Here are the key details for integrating Chainlink VRF on the Morph testnet:
Item | Value |
---|---|
LINK Token | 0x84b9B910527Ad5C03A9Ca831909E21e236EA7b06[2] |
VRF Coordinator | 0x6A2AAd07396B36Fe02a22b33cf443582f682c82f[2][4] |
Key Hash | 0xd4bb89654db74673a187bd804519e65e3f71a52bc55f11da7601a13dcf505314[4] |
Fee | 0.005 LINK[4] |
Max Gas Limit | 2,500,000[4] |
Minimum Confirmations | 3[4] |
Maximum Confirmations | 200[4] |
Maximum Random Values | 500[4] |
Hi @tetyana-pol , pls update your poker game smart contract to work with Chainlink VRF on the Morph testnet:
constructor(
address _vrfCoordinator, // Use Morph testnet coordinator: 0x6A2AAd07396B36Fe02a22b33cf443582f682c82f
address _linkToken, // Use Morph testnet LINK token: 0x84b9B910527Ad5C03A9Ca831909E21e236EA7b06
bytes32 _keyHash, // Use Morph testnet key hash: 0xd4bb89654db74673a187bd804519e65e3f71a52bc55f11da7601a13dcf505314
uint256 _fee // Use Morph testnet fee: 0.005 LINK
) VRFConsumerBase(_vrfCoordinator, _linkToken) {
keyHash = _keyHash;
fee = _fee;
initializeDeck();
}
Fund the contract with Morph testnet LINK tokens: The contract needs a balance of at least 0.005 testnet LINK per VRF request. Testnet LINK can be obtained from the official Chainlink faucet.[2]
Deploy and test on the Morph testnet: Verify that VRF requests are fulfilled successfully. Monitor the RandomnessRequested
and RandomnessFulfilled
events.
Handle any Morph-specific issues: Adjust the contract logic if needed to account for any differences or edge cases when using VRF on Morph compared to other networks.
Document the integration process: Note any key findings or issues encountered to help with future development and debugging on the Morph testnet.
By updating these configuration details, funding the contract with testnet LINK, deploying to the Morph testnet, and thoroughly testing, you can adapt your poker game to leverage Chainlink VRF for secure randomness on the Morph Layer 2 solution.[1][3][5][6]
Cc: @tetyana-pol
Citations: [1] https://smartliquidity.info/2024/02/04/exploring-the-morph-testnet/ [2] https://web3.bitget.com/en/academy/what-is-morph [3] https://docs.chain.link/vrf/v1/supported-networks [4] https://docs.chain.link/vrf/v2/subscription/supported-networks [5] https://docs.chain.link/vrf/v2/direct-funding/supported-networks [6] https://boxmining.com/morph-token-airdrop-guide/
@CoolMan
I have the Morph testnet Chainlink VRF information now. Let's update the deployment process for the BettingAndPotManagement contract with these specific details:
const BettingAndPotManagement = await ethers.getContractFactory("BettingAndPotManagement");
const bettingAndPotManagement = await BettingAndPotManagement.deploy(
roomId, // uint256 - Set this to a unique room identifier
cardManagementAddress, // address - Address of deployed CardManagement contract
roomManagementAddress, // address - Address of deployed RoomManagement contract
userManagementAddress, // address - Address of deployed UserManagement contract
ethers.utils.parseEther("0.1"), // uint256 - Example minimum bet of 0.1 ETH
"0x6A2AAd07396B36Fe02a22b33cf443582f682c82f", // address - Morph VRF Coordinator
"0x84b9B910527Ad5C03A9Ca831909E21e236EA7b06", // address - Morph LINK Token
"0xd4bb89654db74673a187bd804519e65e3f71a52bc55f11da7601a13dcf505314", // bytes32 - Morph VRF Key Hash
ethers.utils.parseEther("0.005") // uint256 - Morph VRF Fee (0.005 LINK)
);
@nomea
Following your instructions, I successfully deployed BettingAndPotManagement contract. Here is updated code. Thank you!
const bettingAndPotManagement = await BettingAndPotManagement.deploy(
roomId, // uint256 - Set this to a unique room identifier
cardManagementAddress, // address - Address of deployed CardManagement contract
roomManagementAddress, // address - Address of deployed RoomManagement contract
userManagementAddress, // address - Address of deployed UserManagement contract
ethers.parseEther("0.1"), // uint256 - Example minimum bet of 0.1 ETH
"0x6A2AAd07396B36Fe02a22b33cf443582f682c82f", // address - Morph VRF Coordinator
"0x84b9B910527Ad5C03A9Ca831909E21e236EA7b06", // address - Morph LINK Token
"0xd4bb89654db74673a187bd804519e65e3f71a52bc55f11da7601a13dcf505314", // bytes32 - Morph VRF Key Hash
ethers.parseEther("0.005") // uint256 - Morph VRF Fee (0.005 LINK)
);
Spike: Research LINK Token and VRF Coordinator on Morph Testnet
Ticket ID: SP-20 Type: Spike
Priority: High
Assignee: [fakename]
Objective
Research and document the availability and implementation details of LINK tokens and the VRF (Verifiable Random Function) coordinator on the Morph testnet.
Tasks
Acceptance Criteria
Time Box
1-2 days
Outcome
The research from this spike will inform our implementation strategy for randomness generation in Skia Poker on the Morph testnet.