hindley-milner-systems / dapp-ertp-airdrop

0 stars 2 forks source link

contract interface unclear - overly flexible? #47

Closed dckc closed 6 months ago

dckc commented 7 months ago

why is the state machine one of the terms? does the contract really work with an arbitrary state machine?

https://github.com/lari-labs/dapp-ertp-airdrop/blob/e74f41b53e5d8b34044cf646cfc41858b5170530/contract/src/airdrop/prepare.js#L66-L67

passing in a purse seems hazardous. The contract can't be sure the caller isn't messing with the purse.

https://github.com/lari-labs/dapp-ertp-airdrop/blob/e74f41b53e5d8b34044cf646cfc41858b5170530/contract/test/airdropZone/test-airdrop.js#L135

Where is the meme token issuer expected to reside? what contract / vat? Shouldn't this contract make it with makeZCFMint?

https://github.com/lari-labs/dapp-ertp-airdrop/blob/e74f41b53e5d8b34044cf646cfc41858b5170530/contract/test/airdropZone/test-airdrop.js#L125

is startTime relative or absolute? usage is absolute:

https://github.com/lari-labs/dapp-ertp-airdrop/blob/e74f41b53e5d8b34044cf646cfc41858b5170530/contract/src/airdrop/prepare.js#L175-L176

but some docs suggest relative:

https://github.com/lari-labs/dapp-ertp-airdrop/blob/e74f41b53e5d8b34044cf646cfc41858b5170530/contract/src/airdrop/prepare.js#L44

I suggest using a realistic / plausible time in your tests; for example:

  const noop = () => {};
  const modernTime = BigInt(new Date(2024, 6, 1, 9).valueOf() / 1000);
  const chainTimerService = buildManualTimer(noop, modernTime, {
    timeStep: 60n,
  });

https://github.com/Agoric/dapp-agoric-basics/blob/5d800a05eae8b77118ee9a8a27e2943fd91dee5c/contract/test/boot-tools.js#L54-L58

linear[bot] commented 7 months ago

LAR-100 contract interface unclear - overly flexible?

dckc commented 7 months ago

and why is distributionSchedule in the exo state when it's already available from static scope?

https://github.com/lari-labs/dapp-ertp-airdrop/blob/e74f41b53e5d8b34044cf646cfc41858b5170530/contract/src/airdrop/prepare.js#L110

https://github.com/lari-labs/dapp-ertp-airdrop/blob/e74f41b53e5d8b34044cf646cfc41858b5170530/contract/src/airdrop/prepare.js#L69

dckc commented 7 months ago

why is prepareAirdropCampaign() not done during the start() function?

https://github.com/lari-labs/dapp-ertp-airdrop/blob/e74f41b53e5d8b34044cf646cfc41858b5170530/contract/src/airdrop/prepare.js#L171

tgrecojs commented 6 months ago

I think this can be closed. can you confirm? @dckc

dckc commented 6 months ago

so yes.