<aside> 💻 This is a project from our W22 Hackathon
</aside>
Showtime now supports eligibility checks based on 3rd party contracts that implement a predefined interface. When people try to collect a drop with a contract condition, we check their eligibility at runtime by calling a view function on the contract that returns a bool
To implement a gating contract, implement this interface and deploy on either Ethereum mainnet or Polygon:
interface IShowtimeEligibilityChecker {
function check(address recipient, address drop) external view returns (bool);
}
See the repo for more Solidity examples:
https://github.com/showtime-xyz/drop-contract-conditions
POST /api/v1/contract-conditions/create
{
"name": "<short-alphanum>",
"chain_id": "<one of [ 1, 137 ] as a string>",
"address": "<contract hex address>"
}
-> returns 201
curl -X 'POST' \\
'<https://showtimenft.wl.r.appspot.com/api/v1/contract-conditions/create>' \\
-H 'accept: */*' \\
-H 'Authorization: Bearer <your jwt>' \\
-H 'Content-Type: application/json' \\
-d '{
"contract_address": "0xDEADBEEF",
"chain_id": "1",
"name": "string"
}'
<aside>
☝ the name
field will be used to display a human readable shorthand in the UI
</aside>
GET /api/v1/contract-conditions/
-> returns 200 with response as follows
[
{
"name": "<short-alphanum>",
"chain_id": "<one of [ 1, 137 ] as a string>",
"address": "<contract hex address>"
}
]
curl -X 'GET' \\
'<https://showtimenft.wl.r.appspot.com/api/v1/contract-conditions/>' \\
-H 'accept: application/json' \\
-H 'Authorization: Bearer <your jwt>'