How to sign a message with a wallet and verify the signature on-chain using ecrecover

Introduction

This is a practical tutorial on how to sign a message using MetaMask and then verify it on-chain.

Here’s a demo: https://leon-do.github.io/ecrecover/

Signing

Note

  • This is using the method personal_signto prevent accidental transaction spending. This will relate to \x19Ethereum Signed Message:\n32 prefix found in the smart contract (below).
  • This is signing…

Get the owner of batch for ERC-721 tokens by using Multicall

Question

Is there a way to get the owner of multiple ERC-721 tokens?

Overview

Most NFTs follow the ERC-721 standard, which must implement certain functions such as Transfer, balanceOf, ownerOf etc. In this example we’ll focus on ownerOf which returns the owner (address) of the NFT.

// solidityfunction ownerOf(uint256 _tokenId) external

A Unity plugin for peer to peer games using WebRTC. Create a WebGL multiplayer game in 5 minutes.

Disclaimer: This project has the ChainSafe family! ChainSafe is incredibly excited to have Leon join us as Head of Gaming. His Unity SDK is now publicly available on ChainSafe’s Github here as the Web3.Unity library, where it will continue to get developed. …

Leon Do

Software Engineer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store