# Signature On-chain Minter Automation [TOC] ###### tags: `Dapp` `區塊鏈` --- ### Connect to the local blockchain by ganache-cli 會使用一組Private key 作為連線metamask         ### Smart contract migrated to the local blockchain--->transactions deployed   ---- ### SmartContract.json--->擁有[ABI](https://medium.com/taipei-ethereum-meetup/ethereum-%E6%99%BA%E8%83%BD%E5%90%88%E7%B4%84%E9%96%8B%E7%99%BC%E7%AD%86%E8%A8%98-%E6%B7%B1%E5%85%A5%E6%99%BA%E8%83%BD%E5%90%88%E7%B4%84-abi-268ececb70ae)  ---- ### 前端react介面 串接好metamask + 可以一鍵 automation deploy 智能合約  * conncect to metamask fail  ---- ### 重新 migrate smart contract(==truffle migrate --reset==)  ---- ### 寫 智能合約jest測試(truffle test)   ---- ### 利用NPM內建[react-signature-canvas](https://www.npmjs.com/package/react-signature-canvas)在前端簽完名後--->轉成png檔 (可在React前端介面完成) * connect to metamask with minter successful  ---- ### 利用[ipfs http client](https://www.npmjs.com/package/ipfs-http-client)將簽名檔可以上傳到IPFS * signature 存成 BUFFER(base64)--->之後要將簽名檔寫在IPFS需求的格式   * [opensea metadata doc](https://docs.opensea.io/docs/2-adding-metadata)上確認等等要上傳IPFS 的 metadata ipfs格式  * [opensea metadata url doc](https://docs.opensea.io/docs/metadata-standards) * [Mint an NFT with IPFS ](https://docs.ipfs.io/how-to/mint-nfts-with-ipfs/#a-short-introduction-to-nfts) * [Welcome to NFT School ](https://nftschool.dev/how-to/auditing-nfts/) * [ipfs-http-client typeerror: failed to construct 'url': invalid url](https://github.com/ipfs-inactive/js-ipfs-http-client#cors) * [串接api產生CORS問題](https://github.com/ipfs-inactive/js-ipfs-http-client#cors) * This would be a CORS ("Cross Origin Resource Sharing") failure: IPFS servers are designed to reject requests from unknown domains by default.  * [在區塊鏈上建立可更新的智慧合約(一)](https://medium.com/@twedusuck/%E5%9C%A8%E5%8D%80%E5%A1%8A%E9%8F%88%E4%B8%8A%E5%BB%BA%E7%AB%8B%E5%8F%AF%E6%9B%B4%E6%96%B0%E7%9A%84%E6%99%BA%E6%85%A7%E5%90%88%E7%B4%84-cbe015bdb339) --- #### ==IPFS http client常見問題==  ---- ### 在infura上串接 IPFS API ---- #### 解決@openzeppelin無法compile智能合約問題 * [直接將openzeppelin整個套件載下來](https://github.com/OpenZeppelin/openzeppelin-contracts) * cmd:$ yarn install @openzeppelin/contracts --- #### 目前前端有bug上傳不到ipfs上   --- * 記得要connected sites  * 選擇想要連線的connected sites跟network的account(預設localhost大部份都是port8545)  * 連線成功囉  * 同意後transaction就成立囉,付gas fee囉  * 成功!mint完的signature nft都列出囉!  * transaction紀錄  * [我 publish的 signature ipfs網址](https://bafybeics5mqxuwd3755oivs2xos5tcqklxn4afy2mfrer2h6hhoxmqiq7i.ipfs.infura-ipfs.io/) ### 補充資料 [What the hack is Memory and Storage in Solidity?](https://medium.com/coinmonks/what-the-hack-is-memory-and-storage-in-solidity-6b9e62577305) [什麼時候用 storage,什麼時候該用 memory?](https://medium.com/taipei-ethereum-meetup/solidity-weekly-9-beae006cee2)
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up