Skip to content

Commit

Permalink
remove observed contract
Browse files Browse the repository at this point in the history
  • Loading branch information
waterflier committed May 12, 2024
1 parent 67f6a89 commit 3757f02
Show file tree
Hide file tree
Showing 11 changed files with 319 additions and 389 deletions.
3 changes: 2 additions & 1 deletion contracts/dividend.sol
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ contract DividendContract is Initializable, UUPSUpgradeable, ReentrancyGuardUpgr

// stake tokens to next cycle
function stake(uint256 amount) external nonReentrant {
require(amount > 0, "Cannot stake 0");
require(amount >0, "Cannot stake 0 DMC");
require(IERC20(stakingToken).transferFrom(msg.sender, address(this), amount), "Stake failed");

console.log("user stake ===> amount %d, cycle %d, user %s", amount, currentCycleIndex, msg.sender);
Expand All @@ -262,6 +262,7 @@ contract DividendContract is Initializable, UUPSUpgradeable, ReentrancyGuardUpgr

// update the total staked amount of the contract
totalStaked += amount;
//TODO: update current cycle's total staked?

// emit the stake event
emit Stake(msg.sender, amount);
Expand Down
219 changes: 0 additions & 219 deletions contracts/dividend2.sol

This file was deleted.

40 changes: 0 additions & 40 deletions contracts/dmc.sol

This file was deleted.

7 changes: 7 additions & 0 deletions contracts/dmc2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import "@openzeppelin/contracts/access/Ownable.sol";

contract DMC2 is ERC20Burnable, Ownable {
mapping (address => bool) allow_minter;
bool can_change_minter = true;

modifier onlyMinter() {
require(allow_minter[msg.sender], "mint not allowed");
Expand All @@ -20,14 +21,20 @@ contract DMC2 is ERC20Burnable, Ownable {
}
_mint(address(this), _totalSupply - totalInited);
}

function disableMinterChange() public onlyOwner {
can_change_minter = false;
}

function enableMinter(address[] calldata addresses) public onlyOwner {
require(can_change_minter, "mint change not allowed");
for (uint i = 0; i < addresses.length; i++) {
allow_minter[addresses[i]] = true;
}
}

function disableMinter(address[] calldata addresses) public onlyOwner {
require(can_change_minter, "mint change not allowed");
for (uint i = 0; i < addresses.length; i++) {
allow_minter[addresses[i]] = false;
}
Expand Down
68 changes: 0 additions & 68 deletions contracts/exchange.sol

This file was deleted.

Loading

0 comments on commit 3757f02

Please sign in to comment.