/
Bean.sol
43 lines (34 loc) · 1.08 KB
/
Bean.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
SPDX-License-Identifier: MIT
*/
pragma solidity ^0.7.6;
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20Burnable.sol";
/**
* @author Publius
* @title Bean is the ERC-20 Stablecoin for Beanstalk.
**/
contract Bean is Ownable, ERC20Burnable {
using SafeMath for uint256;
constructor()
ERC20("Bean", "BEAN")
{ }
function mint(address account, uint256 amount) public onlyOwner returns (bool) {
_mint(account, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
if (allowance(sender, _msgSender()) != uint256(-1)) {
_approve(
sender,
_msgSender(),
allowance(sender, _msgSender()).sub(amount, "Bean: Transfer amount exceeds allowance."));
}
return true;
}
function decimals() public view virtual override returns (uint8) {
return 6;
}
}