This commit is contained in:
owen05
2021-09-24 09:39:15 +08:00
parent 013cbf66ca
commit 9fd16aa1f4
6 changed files with 12 additions and 8 deletions

View File

@@ -224,7 +224,7 @@ contract BaseFilterV1 is InitializableOwnable, ReentrancyGuard {
require(newCr != 0, "CR_INVALID");
_GS_START_IN_ = newGsStart;
_CR_IN_ = newCr;
_NFT_IN_TOGGLE_ = true;
_NFT_IN_TOGGLE_ = toggleFlag;
emit ChangeNFTInPrice(newGsStart, newCr, toggleFlag);
}
@@ -245,7 +245,7 @@ contract BaseFilterV1 is InitializableOwnable, ReentrancyGuard {
require(newCr != 0, "CR_INVALID");
_GS_START_RANDOM_OUT_ = newGsStart;
_CR_RANDOM_OUT_ = newCr;
_NFT_RANDOM_OUT_TOGGLE_ = true;
_NFT_RANDOM_OUT_TOGGLE_ = toggleFlag;
emit ChangeNFTRandomOutPrice(newGsStart, newCr, toggleFlag);
}
@@ -266,7 +266,7 @@ contract BaseFilterV1 is InitializableOwnable, ReentrancyGuard {
require(newCr != 0, "CR_INVALID");
_GS_START_TARGET_OUT_ = newGsStart;
_CR_TARGET_OUT_ = newCr;
_NFT_TARGET_OUT_TOGGLE_ = true;
_NFT_TARGET_OUT_TOGGLE_ = toggleFlag;
emit ChangeNFTTargetOutPrice(newGsStart, newCr, toggleFlag);
}

View File

@@ -40,6 +40,7 @@ contract Controller is InitializableOwnable {
uint256 nftOutFeeRate,
bool isOpen
) external onlyOwner {
require(nftInFeeRate <= 1e18 && nftOutFeeRate <= 1e18, "FEE_RATE_TOO_LARGE");
FilterAdminFeeRateInfo memory feeRateInfo = FilterAdminFeeRateInfo({
nftInFeeRate: nftInFeeRate,
nftOutFeeRate: nftOutFeeRate,
@@ -51,6 +52,7 @@ contract Controller is InitializableOwnable {
}
function setGlobalParam(uint256 nftInFeeRate, uint256 nftOutFeeRate) external onlyOwner {
require(nftInFeeRate <= 1e18 && nftOutFeeRate <= 1e18, "FEE_RATE_TOO_LARGE");
_GLOBAL_NFT_IN_FEE_RATE_ = nftInFeeRate;
_GLOBAL_NFT_OUT_FEE_RATE_ = nftOutFeeRate;

View File

@@ -38,6 +38,7 @@ contract FilterAdmin is InitializableInternalMintableERC20 {
address maintainer,
address[] memory filters
) external {
require(feeRate <= DecimalMath.ONE, "FEE_RATE_TOO_LARGE");
super.init(owner, initSupply, name, symbol, 18);
_INIT_SUPPLY_ = initSupply;
_FEE_RATE_ = feeRate;

View File

@@ -83,6 +83,7 @@ contract FilterERC1155V1 is IERC1155Receiver, BaseFilterV1 {
uint256[] memory amounts,
address to
) external preventReentrant returns (uint256 paid) {
require(tokenIds.length == amounts.length, "PARAM_INVALID");
uint256 avaliableNFTOutAmount = getAvaliableNFTOutAmount();
uint256 originTotalNftAmount = _TOTAL_NFT_AMOUNT_;