You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a contract that inherits from [GelatoVRFConsumerBase](https://github.com/gelatodigital/vrf-contracts/blob/main/contracts/GelatoVRFConsumerBase.sol).
35
+
36
+
```solidity
37
+
// SPDX-License-Identifier: MIT
38
+
pragma solidity 0.8.18;
39
+
40
+
import {GelatoVRFConsumerBase} from "./GelatoVRFConsumerBase.sol";
41
+
42
+
contract YourContract is GelatoVRFConsumerBase {
43
+
// Your contract's code
44
+
}
45
+
```
46
+
47
+
### Step 4: Request Randomness
48
+
49
+
To request randomness, call the \_requestRandomness() function. You should protect the call since it will take from your 1Balance. The data argument will be passed back to you by the W3F.
50
+
51
+
```typescript
52
+
function requestRandomness(bytesmemorydata) external {
53
+
require(msg.sender==...);
54
+
uint64requestId=_requestRandomness(data);
55
+
}
56
+
```
57
+
58
+
### Step 5: Implement Callback Function
59
+
60
+
```typescript
61
+
function _fulfillRandomness(
62
+
bytes32randomness,
63
+
uint64requestId,
64
+
bytesmemorydata,
65
+
) internal override {
66
+
}
67
+
}
68
+
```
69
+
70
+
### Step 6: Include Dedicated msg.sender
71
+
72
+
When you're ready to deploy your Gelato VRF-compatible contract, an important step is to include the dedicated msg.sender as a constructor parameter. This ensures that your contract is set up to work with the correct operator for fulfilling the randomness requests.. It's crucial for ensuring that only authorized requests are processed.
73
+
74
+
```solidity
75
+
// SPDX-License-Identifier: MIT
76
+
pragma solidity 0.8.18;
77
+
78
+
import {GelatoVRFConsumerBase} from "./GelatoVRFConsumerBase.sol";
79
+
80
+
contract YourContract is GelatoVRFConsumerBase {
81
+
constructor(address operator)
82
+
GelatoVRFConsumerBase(operator) {
83
+
// Additional initializations
84
+
}
85
+
86
+
// The rest of your contract code
87
+
}
88
+
```
89
+
90
+
## Task Creation
91
+
92
+
Upon deploying your contract, you will need to create a Gelato Task. This can be done via the [Gelato UI](https://app.gelato.network/).
93
+
Next, you will be prompted to provide the address of the Request Contract to which the Gelato nodes should respond. Enter the address of your contract, and once all details have been correctly entered, proceed with launching your Gelato VRF instance.
94
+
95
+

96
+
97
+
Now every time you call the `_requestRandomness()` function, the Gelato nodes will respond with a random number that you can use in your contract.
98
+
99
+
For more detailed information, refer to the [Gelato VRF documentation](https://docs.gelato.network/docs/gelato-vrf).
Copy file name to clipboardExpand all lines: src/pages/quick-start/faucets.mdx
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -1,18 +1,18 @@
1
1
## Faucets
2
2
Get fake Ether (ETH) from these faucets so you can fund your wallet to send transactions and deploy contracts on Ink Sepolia. You can also [bridge](https://docs.inkonchain.com/quick-start/faucets#bridging-funds-to-ink-sepolia) testnet funds to Ink.
3
3
4
-
###### Kraken
5
-
Our in house faucet provides a quick and easy way to acquire testnet ETH.
6
-
- https://mystery-faucet.demo.inkonchain.com/
4
+
###### Optimism - Superchain Faucet
5
+
- The Superchain Faucet provides testnet ETH for all OP chains, including Ink.
7
6
###### Quicknode
8
7
Quicknode faucet is an easy to use Multi-Chain Faucet. You can use Quicknode Faucet to claim Ink Sepolia for testnet ETH for free - one drip per network every 12 hours.
9
8
- https://quicknode.com
10
9
###### Tenderly
11
10
Tenderly Node is a fast and reliable production node that enables access to over 12 blockchain networks via RPC. It allows you to send transactions, deploy smart contracts, query blockchain data or other operations without having to run your own node or manage infrastructure.
12
-
- https://tenderly.co
13
-
###### Optimism
14
-
###### Superchain
15
-
- The Superchain Faucet provides testnet ETH for all OP chains, including Ink.
11
+
- https://tenderly.co
12
+
###### Kraken
13
+
Our in house faucet provides a quick and easy way to acquire testnet ETH.
14
+
- https://mystery-faucet.demo.inkonchain.com/
15
+
16
16
17
17
## Bridging funds to Ink Sepolia
18
18
If you need an alternative to the above faucets you can choose to bridge ETH onto Ink Sepolia.
| Block Explorer |https://explorer-sepolia.inkonchain.com|
22
21
23
22
24
-
## What Do I Need to Start Developing on Ink?
25
-
1. An editor (with a Solidity highlighting package) like Visual Studio Code
26
-
2. A web3 wallet
27
-
3. Testnet funds
28
-
4. Recommended: a development framework like Foundry or Hardhat
29
-
5. If you want to deploy code to the blockchain through the browser, a web3 browser extension (most web3 wallets will have one)
23
+
## What do I Need to Start Developing on Ink?
24
+
1. An editor (with a Solidity highlighting package) like [Visual Studio Code](https://code.visualstudio.com/) to efficiently write smart contract code. This code will need the be compiled before deployment; see Step 4.
25
+
2. A web3 wallet that holds funds to transact and deploy blockchain code such as [Kraken Wallet](https://www.kraken.com/wallet)
26
+
3. Testnet funds to fund your transactions (see [Get Testnet Funds](/quick-start/faucets))
27
+
4. Recommended: a development framework like [Foundry](https://book.getfoundry.sh/) or [Hardhat](https://hardhat.org/) to streamline smart contract development.
28
+
- You will need the private key to your wallet account to deploy through these frameworks.
29
+
- These frameworks can also take care of code compilation for you - otherwise you will need a standalone [solution](https://docs.soliditylang.org/en/latest/installing-solidity.html).
30
+
5. If you want to deploy code to the blockchain through the browser instead, a web3 browser extension (most web3 wallets will have one)
30
31
31
-
As an alternative to most of the above you can use [Remix](https://remix.ethereum.org/), but you will still need a web3 wallet with funds to deploy your code.
32
+
As an alternative to most of the above you can use [Remix](https://remix.ethereum.org/), but you will still need a web3 wallet browser extension with funds to deploy your code.
32
33
33
34
## Connecting to Ink
34
35
@@ -37,13 +38,13 @@ In order to deploy code to Ink, you need a blockchain wallet that has funds in i
37
38
2. Connecting the wallet to the Ink chain
38
39
3. Getting funds to use on Ink from a [faucet](https://https://docs.inkonchain.com/quick-start/faucets) or by [bridging]()
39
40
40
-
###### Creating a wallet
41
-
1. Get a wallet from [Rabby](https://rabby.io/), [Metamask](https://metamask.io/), [Rainbow](https://rainbow.me/en-us/) or many more.
42
-
- Make sure your wallet is EVM compatible i.e. works with Ethereum-based chains. The ones mentioned above do.
41
+
###### Creating a Wallet
42
+
1. Get a wallet from [Kraken Wallet](https://www.kraken.com/wallet), [Metamask](https://metamask.io/), [Rainbow](https://rainbow.me/en-us/) or many more.
43
+
- Make sure your wallet is EVM compatible i.e. works with Ethereum-based chains. The ones mentioned above do.
43
44
- Use the browser extension of the wallet you chose to simplify deploying code.
44
45
2. Set up your wallet, which will include writing down a mnemonic (a set of words) and getting an address that starts with "0x".
45
46
46
-
###### Connecting Metamask wallet to Ink Sepolia (Testnet)
47
+
###### Connecting Metamask Wallet to Ink Sepolia (Testnet)
47
48
48
49
In order to connect your wallet to Ink you must add Ink Sepolia as a custom network. Note that your wallet should be EVM-compatible.
49
50
@@ -59,10 +60,12 @@ Next: get some [play money](#faucet) from our faucets!
59
60
60
61

61
62
62
-
###### Fund your wallet
63
-
Get fake Ether (ETH) from these faucets so you can fund your wallet to send transactions and deploy contracts on Ink Sepolia. Kraken's in house faucet provides a quick and easy way to acquire testnet ETH:
64
-
https://mystery-faucet.demo.inkonchain.com/
63
+
###### Fund your Wallet
64
+
Get fake Ether (ETH) from these faucets so you can fund your wallet to send transactions and deploy contracts on Ink Sepolia.
65
+
66
+
Check out faucets [here](https://docs.inkonchain.com/quick-start/faucets). Alternatively, you can [bridge](https://docs.inkonchain.com/quick-start/faucets#bridging-funds-to-ink-sepolia) testnet funds.
65
67
66
-
Check out alternative faucets [here](https://docs.inkonchain.com/quick-start/faucets). Alternatively, you can [bridge](https://docs.inkonchain.com/quick-start/faucets#bridging-funds-to-ink-sepolia) testnet funds.
68
+
## What Next?
69
+
Check out the [tutorials](/build/tutorials) to learn how to deploy contracts on Ink and more!
0 commit comments