rmx-party / hacks

1 stars 0 forks source link

Enable one-click minting #4

Closed paigel closed 1 year ago

paigel commented 1 year ago

User Story

User mints two separate NFTs in a single minting transaction. User receives 2 NFTs as SVGs with embedded text:

(NFT details are in #3 )

paigel commented 1 year ago

Part of #1 : the primary output feature we want out of the Etherspot SDK

brandondees commented 1 year ago

per etherspot SDK requirements, this will require triggering an 'estimate transaction' process before we can allow the user to click 'mint', which will generate errors if the transaction is invalid before submitting it, and will yield a cost estimation that the user can be shown to decide whether to proceed.

paigel commented 1 year ago

per etherspot SDK requirements, this will require triggering an 'estimate transaction' process before we can allow the user to click 'mint', which will generate errors if the transaction is invalid before submitting it, and will yield a cost estimation that the user can be shown to decide whether to proceed.

@brandondees two questions:

brandondees commented 1 year ago

@paigel yeah we're not tackling any special fee handling, it's the usual user pays model, and that also means the user has to transfer money into their new wallet to use it. i figured we'll just put text on the screen to explain that, along with the address.

brandondees commented 1 year ago

@paigel invalid could be a lot of things but things like if the contract function is unprocessable due to bad inputs or if the code makes it impossible to estimate the gas cost, or user doesn't have enough money, or they're trying to do something unauthorized, etc. -- usually this shouldn't happen if our smart contract is done right but there can also be other edge cases like the RPC server having problems, network connection failure, etc.

brandondees commented 1 year ago

the point of mentioning it is that the requirement to pre-estimate the transaction is for reasons, not an arbitrary choice we're making or that's arbitrary on etherspot's part.

paigel commented 1 year ago

okay got it, thank you for the extra info!

brandondees commented 1 year ago

Image

transaction sends but then reverts. our app code doesn't get a helpful error message but this info on polygonscan is a good clue. it seems like i accidentally left some openzeppelin boilerplate code that requires minting permission to be explicitly granted per address. i'll try doing that manually for now to confirm. then we have a decision to make: do we remove the role checking and re-deploy the contract so that it's public-demoable, or just leave it as is since we don't expect people to want to use it?

paigel commented 1 year ago

confirmed that we left as-is and do not have a public demo.