WINTฮžR ๐Ÿ’™๐Ÿ’› Profile picture
Mar 14 โ€ข 8 tweets โ€ข 4 min read
Best practices when handing payments ๐Ÿ’ธ in NFT contracts #solidity โ†“
Pull, don't push.
* If you forward ether payments from your mint function, it makes minting more expensive.
* If your contract gets some Ether without triggering the mint function, these funds will be lost forever.

Instead, make a function that transfers you the full balance. Image
Note that the withdrawAll function isn't marked as onlyOwner. Anyone can call it. This lets you set up automation (e.g. via Infura or OZ defender) that doesn't depend on your private keys. Image
While you are here, it's also a good idea to include a function that does the same but for any ERC20 token.

There are plenty of ways your contract can get these, and it would be unfortunate to lose thousands of dollars by not implementing this simple function. Image
Always check for the exact payment value.

I used msg.value > X ether in my first NFT contract, and it caused a lot of headaches. Some users minted from Etherscan's UI and miscalculated the proper value, and then chased me asking for a refund (which I did). Not fun. Image
Royalties (IERC2981) is a good idea, but there are some gotchas. The payment token can be anything, so make sure the royalties receiver is either the owner or the contract has a way to extract ERC20s. Here's an example where funds got locked forever
Here's how we are implementing royalties support for @watchfacesworld. Note that we can upgrade the royaltyInfo in the future by supplying a new implementation. This is cool because we could offer our holders some royalties (no promises ๐Ÿ˜…), without locking the logic now. Image
Last 2๐Ÿ’ธ tips for now:

1) Use a shared @gnosisSafe for your team (ideally with N/M signatures requirement). It'd really suck to lose your hard earnings in case someone is compromised.

2) Use @0xSplits to painlessly split the profits.

โ€ข โ€ข โ€ข

Missing some Tweet in this thread? You can try to force a refresh
ใ€€

Keep Current with WINTฮžR ๐Ÿ’™๐Ÿ’›

WINTฮžR ๐Ÿ’™๐Ÿ’› Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @w1nt3r_eth

Mar 16
Why not L2?

Someone on Discord asked why we choose to go with Ethereum mainnet for @watchfacesworld NFT instead of an L2. Here's our thinking process on thisโ€ฆ
We want to make Watchfaces last forever. The kind of antique rare physical timepieces that represent the times they were crafted in.

It's fully on-chain and will be alive for as long as Ethereum is alive. No external dependencies, no servers, no IPFS.
We don't have any plans to have active on-chain utility (like some games or art projects) that would require many transactions and would benefit from being on L2. Thus, the main benefit (as I see it) of L2 would be a cheaper deployment cost. Currently, we estimate to spend 1.5ฮžโ€ฆ
Read 6 tweets
Mar 15
Should you build a minting pass for your upcoming NFT project? I definitely recommend you do! Itโ€™s actually super simple, and Iโ€™ve learned a lot when building one for @watchfacesworld.

Here are 3 principles I want to share, a few bonus tips, and a code sample โ†“ Image
First, what is a minting pass?

It's a simple NFT token that gives the holder access to private minting. They became very popular lately, esp. for high-profile projects to help alleviate gas wars and frustrations.

But minting passes can be useful for every upcoming NFT project
Principle 1: Minting pass is a relationship.

When someone says your project is cool, it's inspiring, but means very little.

When someone buys a pass for your project, it's a strong signal that they are interested. Ask them how they found you, give them special perks.
Read 11 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(