修改一些变量名

This commit is contained in:
cebgcontract 2022-08-17 17:25:47 +08:00
parent e99db1c879
commit 65ce1fbcd9
3 changed files with 11 additions and 11 deletions

View File

@ -4,9 +4,9 @@ pragma solidity 0.8.10;
contract FactoryBase { contract FactoryBase {
struct ShardParam { struct ShardParam {
address to; address to;
uint256 tokenId; uint256 nftId;
address payToken; address payToken;
uint256 tokenAmount; uint256 payAmount;
uint256 startTime; uint256 startTime;
uint256 saltNonce; uint256 saltNonce;
} }

View File

@ -206,21 +206,21 @@ contract MinterFactory is Ownable, FactoryBase, TimeChecker, Initializable, HasS
// Check payment approval and buyer balance // Check payment approval and buyer balance
IERC20 paymentContract = IERC20(param.payToken); IERC20 paymentContract = IERC20(param.payToken);
require( require(
paymentContract.balanceOf(param.to) >= param.tokenAmount, paymentContract.balanceOf(param.to) >= param.payAmount,
"MinterFactory: doesn't have enough token to mix shard" "MinterFactory: doesn't have enough token to mix shard"
); );
require( require(
paymentContract.allowance(param.to, address(this)) >= param.tokenAmount, paymentContract.allowance(param.to, address(this)) >= param.payAmount,
"MinterFactory: doesn't approve MinterFactory to spend payment amount" "MinterFactory: doesn't approve MinterFactory to spend payment amount"
); );
// transfer money to address // transfer money to address
paymentContract.safeTransferFrom( paymentContract.safeTransferFrom(
param.to, param.to,
feeToAddress, feeToAddress,
param.tokenAmount param.payAmount
); );
shard.burnBatch(param.to, ids, amounts); shard.burnBatch(param.to, ids, amounts);
mint721NFT(param.to, param.tokenId, nft); mint721NFT(param.to, param.nftId, nft);
useSignature(signature); useSignature(signature);
} }
@ -281,9 +281,9 @@ contract MinterFactory is Ownable, FactoryBase, TimeChecker, Initializable, HasS
abi.encodePacked( abi.encodePacked(
param.to, param.to,
nftAddress, nftAddress,
param.tokenId, param.nftId,
param.payToken, param.payToken,
param.tokenAmount, param.payAmount,
param.startTime, param.startTime,
param.saltNonce param.saltNonce
); );

View File

@ -182,7 +182,7 @@ contract UserMinterFactory is Ownable, FactoryBase, Initializable {
uint256 nftId, uint256 nftId,
uint8 nftType, uint8 nftType,
address payToken, address payToken,
uint256 tokenAmount, uint256 payAmount,
uint256[] memory ids, uint256[] memory ids,
uint256[] memory amounts, uint256[] memory amounts,
uint256 startTime, uint256 startTime,
@ -197,7 +197,7 @@ contract UserMinterFactory is Ownable, FactoryBase, Initializable {
nft = equip; nft = equip;
} }
ShardParam memory param = ShardParam( ShardParam memory param = ShardParam(
to, nftId, payToken, tokenAmount, startTime, saltNonce); to, nftId, payToken, payAmount, startTime, saltNonce);
try factory.shardMixByUser( try factory.shardMixByUser(
param, param,
ids, ids,