mirror of
https://github.com/getwax/BLSWallet-ERC20-demo.git
synced 2026-01-06 19:13:57 -05:00
master
BLS Wallet Demo App
How to setup
- deploy Generic ERC20 contract with minting ability
eg -
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract Token is ERC20 {
constructor(string memory name_, string memory symbol_)
ERC20(name_, symbol_)
{}
function mint(address _account, uint256 _amount) public {
_mint(_account, _amount);
}
}
- deploy a spender contract (any contract which can pull tokens from user)
eg -
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
contract Spender {
function pullTokens(address _token, uint256 _amount) public {
IERC20(_token).transferFrom(msg.sender, address(this), _amount);
}
}
- note the addresses for the 2 contracts
- update
.envfile with the 2 addresses - run
yarn install - run
yarn start - connect Quill Wallet
Description
Languages
TypeScript
96.8%
HTML
2.3%
CSS
0.6%
JavaScript
0.3%