在上一章跟我一起阅读并修复某知名DEX交易所源码(3:编译工程,源码分析)之五_lixiaodog的博客-优快云博客
中我们详细分析了 contract MdexPair的源码,本章将继续编译的进程,来吧,少年,出发吧!!
输入编译命令truffle compile
project:/contracts/mainnet/CoinChef.sol:48:43: TypeError: Operator ** not compatible with types int_const 100 and int_const 1000000000000000000
uint256 public constant mdxPerBlock = 100 ** 1e18;
**运算符无法用于这两个常数,我认为应该是写错了,修改为:
uint256 public constant mdxPerBlock = 100*10**18;
每区块产量100个。如果是100**1E18 ,是个多大的数大家可以想像。
再次编译,如下图:
> Duplicate contract names found for TransferHelper.
> This can cause errors and unknown behavior. Please rename one of your contracts.
> Duplicate contract names found for IWHT.
> This can cause errors and unknown behavior. Please rename one of your contracts.
> Duplicate contract names found for TransferHelper.
> This can cause errors and unknown behavior. Please rename one of your contracts.
> Duplicate contract names found for MdxToken.