Distribute with Merkl ðģïļ Deploy your campaign from a DAOGuide to deploy a Merkl Campaign from a DAO
To successfully deploy your campaign, you will need to create a campaign payload, then use the Foundry Forge CLI to generate the calldata for a DAO proposal.
Create the calldata
Follow these steps to build the payload and finalize your campaign creation:
The example below is for Arbitrum network . Be sure to select the correct address for the Creator contract on your network: https://app.merkl.xyz/status
Create the approval transaction
Approve the Creator contract to spend tokens. Don't forget the Merkl fee in your calculation.
Copy cast calldata "approve(address,uint256) 0x8BB4C975Ff3c250e0ceEA271728547f3802B36Fd 35175873467336683417086
Then use the output to craft the proposal action, for example:
Copy {
"target" : "0x000D636bD52BFc1B3a699165Ef5aa340BEA8939c" ,
"calldata" : "0x095ea7b30000000000000000000000008bb4c975ff3c250e0ceea271728547f3802b36fd000000000000000000000000000000000000000000000772e34ed4c71327edfe"
}
Create the ToS transaction Sign the Merkl terms of service
Copy cast calldata "acceptConditions()"
Example result:
Copy {
"target" : "0x8BB4C975Ff3c250e0ceEA271728547f3802B36Fd" ,
"calldata" : "0x63b87bf0"
}
The campaign becomes available at `startTime + duration`. NOTE: `duration` is NOT the length of time in which users can claim. Here is the function selector for reference:
Copy createCampaign (
tuple (
bytes32 , // campaignId
address , // creator
address , // rewardToken
uint256 , // amount
uint32 , // campaignType
uint32 , // startTimestamp
uint32 , // duration
bytes , // campaignData
) ,
)
Copy ;[
'0x0000000000000000000000000000000000000000000000000000000000000000' ,
'0x0000000000000000000000000000000000000000' ,
'0x000D636bD52BFc1B3a699165Ef5aa340BEA8939c' ,
'35175873467336683417086' ,
4 ,
1734307200 ,
3600 ,
'0x000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000005568747470733a2f2f616e676c652d626c6f672e696e667572612d697066732e696f2f697066732f516d5558667658666274526576376d377750796a464d4c736a777568457a676e796a334653376172714b69446f33000000000000000000000000000000000000000000000000000000000000000000000000000000000000194f70656e20446f6c6c617220626f6c74732072657761726473000000000000000000000000000000000000000000000000000000000000000000000000000000',
]
Then update the format to be compatible with the Foundry CLI:
Replace the square brackets [
with parenthesis (
Add single quotes '
For example:
Copy '(0x0000000000000000000000000000000000000000000000000000000000000000,0x0000000000000000000000000000000000000000,0x000D636bD52BFc1B3a699165Ef5aa340BEA8939c,35175873467336683417086,4,1734307200,3600,0x000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000005568747470733a2f2f616e676c652d626c6f672e696e667572612d697066732e696f2f697066732f516d5558667658666274526576376d377750796a464d4c736a777568457a676e796a334653376172714b69446f33000000000000000000000000000000000000000000000000000000000000000000000000000000000000194f70656e20446f6c6c617220626f6c74732072657761726473000000000000000000000000000000000000000000000000000000000000000000000000000000)'
Create the createCampaign
transaction Run the cast command using the the properly formatted payload
Copy cast calldata "createCampaign(tuple(bytes32,address,address,uint256,uint32,uint32,uint32,bytes))" '<YOUR_PAYLOAD>'
// Example
cast calldata "createCampaign(tuple(bytes32,address,address,uint256,uint32,uint32,uint32,bytes))" '(0x0000000000000000000000000000000000000000000000000000000000000000,0x0000000000000000000000000000000000000000,0x000D636bD52BFc1B3a699165Ef5aa340BEA8939c,35175873467336683417086,4,1734307200,3600,0x000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000005568747470733a2f2f616e676c652d626c6f672e696e667572612d697066732e696f2f697066732f516d5558667658666274526576376d377750796a464d4c736a777568457a676e796a334653376172714b69446f33000000000000000000000000000000000000000000000000000000000000000000000000000000000000194f70656e20446f6c6c617220626f6c74732072657761726473000000000000000000000000000000000000000000000000000000000000000000000000000000)'
The third and final transaction will look like this:
Copy {
"target" : "0x8BB4C975Ff3c250e0ceEA271728547f3802B36Fd" ,
"calldata": "0xa63f05ad000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d636bd52bfc1b3a699165ef5aa340bea8939c000000000000000000000000000000000000000000000772e34ed4c71327edfe000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000675f6d800000000000000000000000000000000000000000000000000000000000000e1000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000005568747470733a2f2f616e676c652d626c6f672e696e667572612d697066732e696f2f697066732f516d5558667658666274526576376d377750796a464d4c736a777568457a676e796a334653376172714b69446f33000000000000000000000000000000000000000000000000000000000000000000000000000000000000194f70656e20446f6c6c617220626f6c74732072657761726473000000000000000000000000000000000000000000000000000000000000000000000000000000"
}