Skip to content

Commit

Permalink
Shorten Maximum KtonDAO Ring-Deposit Locking Period to 12 Months (#29)
Browse files Browse the repository at this point in the history
* Shorten Maximum KtonDAO Ring-Deposit Locking Period to 12 Months

* deploy

* fix ci
  • Loading branch information
hujw77 authored Oct 22, 2024
1 parent cb41ca4 commit d789110
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions script/Migrate.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ import {CollatorStakingHub} from "../src/collator/CollatorStakingHub.sol";
import {Deposit} from "../src/deposit/Deposit.sol";

contract MigrateScript is Script {
address proxy = 0xa4fFAC7A5Da311D724eD47393848f694Baee7930;
// address proxy = 0xa4fFAC7A5Da311D724eD47393848f694Baee7930;

function run() public {
vm.startBroadcast();

address logic = address(new CollatorStakingHub());
// address logic = address(new Deposit());
// address logic = address(new CollatorStakingHub());
address logic = address(new Deposit());
// Core.upgradeProxyTo(proxy, logic, "");
// require(logic == Upgrades.getImplementationAddress(proxy));
safeconsole.log("logic: ", logic);
Expand Down
3 changes: 2 additions & 1 deletion src/deposit/Deposit.sol
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ contract Deposit is
// System Account.
address public constant SYSTEM_PALLET = 0x6D6f646c64612f74727372790000000000000000;
IKTON public constant KTON = IKTON(0x0000000000000000000000000000000000000402);
uint256 public constant MAX_LOCK_PERIOD = 12;

event DepositCreated(
uint256 indexed depositId, address indexed account, uint256 value, uint256 months, uint256 interest
Expand Down Expand Up @@ -165,7 +166,7 @@ contract Deposit is

function _deposit(address account, uint256 value, uint64 months) internal returns (uint256) {
require(value > 0 && value < type(uint128).max);
require(months <= 36 && months >= 1);
require(months <= MAX_LOCK_PERIOD && months >= 1);

uint256 id = _nextTokenId++;
depositOf[id] = DepositInfo({months: months, startAt: uint64(block.timestamp), value: uint128(value)});
Expand Down
2 changes: 1 addition & 1 deletion verify/Deposit.json

Large diffs are not rendered by default.

0 comments on commit d789110

Please sign in to comment.