Infinite Auction for Ukraine

These are good questions. I’m copying my answer from the Discord here as well.

The smart contract is a pretty standard one based on the OpenZeppelin library, which is used by most of NFT projects and is very well tested. I made two important modifications:

  1. The money goes straight to the charity wallet . When you mint a new NFT the money doesn’t stay in the smart contract as usual, but is directly being sent to the charity wallet configured permanently in the contract. The contract owner has no control over the funds - everything is automatic. This happens here: https://rinkeby.etherscan.io/address/0xd6e8be3a4c0dcaa6430b3de9549591ee0f3ec21c#code#F1#L32

  2. The “capture” function . When you mint the NFT your wallet will be registered as the owner on the blockchain - there is no difference than a regular NFT collection. The thing is, that the smart contract always has full control over the owner information (it is a variable in the contract). The capture function will check if the amount of Eth sent is higher than what was paid before and if yes will set the token owner to the new wallet (and the money again goes straight to the charity wallet). It doesn’t matter if you transferred it to another wallet. This is here: https://rinkeby.etherscan.io/address/0xd6e8be3a4c0dcaa6430b3de9549591ee0f3ec21c#code#F1#L35

This is in the nature of the NFT smart contracts - the code of the contract can do anything with the tokens as long as this functionality is implemented. Most NFT collections of course don’t implement these functions and smart contract code cannot be modified. What I do here is some very specific logic, that allows somebody else to “capture” the NFT, only if they pay money to charity.

These mechanics were largely inspired by what Pak and manifold are doing. For example, check out the Hate collection