Just asking if there happens to exist a standard contract for jetton sale to holders of a specific NFT?
The contract is initialized by sending an amount of some kind of jetton with a message defining the exchange rate (how many jettons are worth a TON), which NFT is required and which attribute it must have, minimum and maximum amounts that a participant can buy. Now (or at a given time) the contract checks which wallets have a matching NFT and saves their addresses. After this point, holders could sell the NFT and still participate in the sale, but not the buyer.
Now that the contract is initialized, TON can be sent to it. If the sender is not a participant, the TON is bounced. Else, the amount is added to the participant's balance. If the balance is below the minimum, it is bounced. If the balance is above the maximum, the surplus is bounced.
After a week (or so), the jettons are allocated to the participants and sent to them, together with any surplus TON that was not used to buy jettons (because there was not enough to buy). Any unsold jettons are sent back where they came from, together with the TON that was paid for jettons.
After this, the sale is completed and anything sent to the contract is bounced.
Aug 16, 2023, 8:11 PM