Skip to content

Commit

Permalink
Fix conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
lurenpluto committed May 1, 2024
1 parent 15effe6 commit 3ed274c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
12 changes: 6 additions & 6 deletions contracts/dividend.sol
Original file line number Diff line number Diff line change
Expand Up @@ -77,21 +77,21 @@ contract DividendContract is Initializable, UUPSUpgradeable, ReentrancyGuardUpgr
event NewCycle(uint256 cycleIndex, uint256 startBlock);
event Withdraw(address indexed user, address token, uint256 amount);

function initialize(address _stakingToken, uint256 _cycleMaxLength, address[] memory tokenList) public initializer {
function initialize(address _stakingToken, uint256 _cycleMaxLength, address[] memory _tokenList) public initializer {
__UUPSUpgradeable_init();
__ReentrancyGuard_init();
__Ownable_init(msg.sender);
__DividendContractUpgradable_init(_stakingToken, _cycleMaxLength, tokenList);
__DividendContractUpgradable_init(_stakingToken, _cycleMaxLength, _tokenList);
}

function __DividendContractUpgradable_init(address _stakingToken, uint256 _cycleMaxLength, address[] memory tokenList) public onlyInitializing {
function __DividendContractUpgradable_init(address _stakingToken, uint256 _cycleMaxLength, address[] memory _tokenList) public onlyInitializing {
stakingToken = _stakingToken;
cycleMaxLength = _cycleMaxLength;
cycleStartBlock = block.number;

for (uint i = 0; i < tokenList.length; i++) {
tokenWhiteList[tokenList[i]] = true;
tokenWhiteListArray.push(tokenList[i]);
for (uint i = 0; i < _tokenList.length; i++) {
tokenWhiteList[_tokenList[i]] = true;
tokenWhiteListArray.push(_tokenList[i]);
}
}

Expand Down
14 changes: 5 additions & 9 deletions test/test_dividend2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,13 @@ describe("Devidend", function () {
//dividend = await (await ethers.deployContract("Dividend2", [await dmc.getAddress(), 1000])).waitForDeployment()

// add init token address as white list, address(0) and gwt token address
//await (await dividend.addTokenAddress(await gwt.getAddress())).wait();
//await (await dividend.addTokenAddress("0x"
const tokenWhiteList = [await gwt.getAddress(), "0x0000000000000000000000000000000000000000"];

dividend = await (
await ethers.deployContract("DividendContract", [
await dmc.getAddress(),
1000,
tokenWhiteList,
])
).waitForDeployment();
dividend = await (await upgrades.deployProxy(await ethers.getContractFactory("DividendContract"), [
await dmc.getAddress(),
1000,
tokenWhiteList
])).waitForDeployment() as unknown as DividendContract;

// 给signers[0] 1000个GWT
await (await gwt.enableMinter([signers[0].address])).wait();
Expand Down

0 comments on commit 3ed274c

Please sign in to comment.