Our great sponsors
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
I modified my code to use EIP712 to require an authorized wallet to also sign in order for an NFT to be minted. I based this off of this: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/7e814a3074baa921db584c180ff6e300cdec8735/contracts/token/ERC20/extensions/ERC20Permit.sol. This is an example of someone calling a smart contract containing this ERC20Permit.sol code https://github.com/Uniswap/v3-periphery/blob/main/test/shared/permit.ts. This particular ERC20Permit.sol code is designed to allow an account to approve ERC20 spend limits without spending gas fees but the same underlying mechanisms could be applied to my use case.
I modified my code to use EIP712 to require an authorized wallet to also sign in order for an NFT to be minted. I based this off of this: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/7e814a3074baa921db584c180ff6e300cdec8735/contracts/token/ERC20/extensions/ERC20Permit.sol. This is an example of someone calling a smart contract containing this ERC20Permit.sol code https://github.com/Uniswap/v3-periphery/blob/main/test/shared/permit.ts. This particular ERC20Permit.sol code is designed to allow an account to approve ERC20 spend limits without spending gas fees but the same underlying mechanisms could be applied to my use case.
This is a next.js repo I made to mint an NFT from the above smart contract https://github.com/ChristianOConnor/nft-sig-verify-mint-eip712-style. My running instance of the above smart contract is 0x509de904bB414701A1Fad31370c28631CcF5e4A6. I hardcoded this into the next.js app. The next.js app requires the private key for the authorizedAccount (which is 0x82d6d541FEB42aa62A7C6E0E8045Dc0458ff648c). I have the line:
Related posts
- Mode - Comprehensive Starter Guide
- Construir e implementar un VAULT (bóveda) ERC20 en Shardeum
- Are ERC-777 Unsafe?
- OpenZeppelin is trying to avoid paying a bounty for a vulnerability that caused $1,1B worth of assets freeze
- OpenZeppelin is trying to avoid paying a bounty for a vulnerability that caused $1,1B worth of assets freeze