区块链最重要的功能,就是建立一种价值共识,而这个“共识”,主要基于“价值量化的能力”和“价值安全的过程”两个方面。先是“价值量化能力”:把一件事通过数字化的方式描述清楚,就是一个价值量化的过程。
其次是“价值安全的过程”:通过数字化的方式描述清楚后,还要保护数据不被篡改,并可以随时随地地查询。,这两个方面叠加起来,就形成了价值共识。所以,区块链在数据互通机制、信用体系的搭建上,必将发挥非常重要的作用。
contract UniswapV2ERC20 is IUniswapV2ERC20 {
using SafeMath for uint;
string public constant name = 'Uniswap V2';
string public constant symbol = 'UNI-V2';
uint8 public constant decimals = 18;
uint public totalSupply;
mapping(address => uint) public balanceOf;
mapping(address => mapping(address => uint)) public allowance;
bytes32 public DOMAIN_SEPARATOR;
// keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
bytes32 public constant PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;
mapping(address => uint) public nonces;
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
constructor() public {
uint chainId;
assembly {
chainId := chainid
}
DOMAIN_SEPARATOR = keccak256(
abi.encode(
keccak256('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)'),
keccak256(bytes(name)),
keccak256(bytes('1')),
chainId,
address(this)