To unify all linkdrop types (campaigns, p2p, modules, on-ramps) we need common interface.
This will allow to utilize the same claim code (claim web apps, API, SDK, URI) for all kinds of the linkdrops,
reducing the need to repeat ourselves again and again.
The idea is to allow different ways to generate linkdrops (dashboard, sdk, wallets), but interoperable way to claim all kind of linkdrops.
interface Ilinkdrop {
// common functions
function isClaimedLink(address _linkId) external view returns (bool);
function isCanceledLink(address _linkId) external view returns (bool);
function cancel(address _linkId) external returns (bool);
function withdraw() external returns (bool);
function addSigner(address _linkdropSigner) external payable returns (bool);
function removeSigner(address _linkdropSigner) external returns (bool);
// claim fungible tokens / eth
function claim
(
uint _weiAmount,
address _tokenAddress,
uint _tokenAmount,
uint _expiration,
address _linkId,
bytes calldata _signerSignature,
address payable _receiver,
bytes calldata _receiverSignature,
address payable _feeReceiver,
uint _feeAmount,
uint _feeToken
)
external returns (bool);
}
POST /linkdrops/claim
Params:
- linkdropContract
- weiAmount
- tokenAmount
- expiration
- linkId
- signerSig
- receiver
- receiverSig
- feeReceiver
- feeAmount
- feeToken
- chainId
- version
/#/receive?weiAmount=10000000000&tokenAddress=0x0000000000000000000000000000000000000000&tokenAmount=0&expirationTime=1900000000000&chainId=100&linkKey=0x3a0c6e592f65a9172fb5928aa487e79dd6c9e2a8a3f731e302aa32260273ff63&linkdropSignerSignature=0x123210c51ced0d2070bba72e1d1df620d342a620a4f29a65a3a5809a4190eba80d4491aff3003f01be65c0fa414a55e6ba2f7a44ed1e5232e9f06cb7947d72dc1b&linkdropContract=0x0000000000000000000000000000000000000111
Renaming
- LinkdropMasterAddress -> sender
- linkdropSignerSignature -> signerSignature
URI
- Remove campaignId from the URI, use direct linkdrop address instead
- Sender generates a link and deploys Linkdrop Contract if needed
- Sender registers the link with relayer
- Sender shares the link with Receiver
- Receiver's browser grabs ...