0

I'm new to solidity but I'm determined to learn. My question is, would it be possible to issue a custom token with a maximum supply of 100, which would act as shares? And then for the smart contract to act in a way that after the sale of a NFT, the ETH would get automatically distributed to the owners of the tokens?

The custom tokens would be set up in such a way, that the owner of them would enter their wallet address which would get assigned to the token and used when executing the smart contract, and if the owner holds multiple tokens, then maybe the code could auto map all of them to the same address, which would save up on gas when executing the smart contract?

If it's possible, how should I go about doing it? I want to learn

1 Answer 1

0
  • Save a list of users that the contract will transfer to.
  • When they deposit, save how much they deposited. This will be useful when distributing the ETH.
  • Define a function that transfers ETH to the addresses in the saved list with the corresponding number. This function can be called at after every X time.
address[] depositedAddresses; // An array that keeps track of addresses who deposited
mapping (address => uint256) deposits;
1
  • can the address list be updated as the tokens that represent the shares are traded? Mar 2 at 16:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.