proposal-47/contracts/Proposal.sol

37 lines
1.3 KiB
Solidity
Raw Normal View History

2024-01-31 15:04:44 +03:00
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.9;
import "./libraries/Types.sol";
import "./interfaces/IERC20.sol";
import { ISablierAirdrop } from "./interfaces/ISablierAirdrop.sol"; // copied from proposal 28
contract Proposal {
IERC20 public constant torn = IERC20(0x77777FeDdddFfC19Ff86DB637967013e6C6A116C);
ISablierAirdrop public immutable airdrop;
uint256 public constant airdropDuration = 180 days;
Types.Recipient[] public recipients;
constructor(address _airdropContract) {
Types.Recipient[1] memory _recipients = [
Types.Recipient({
addr: 0xeb3E49Af2aB5D5D0f83A9289cF5a34d9e1f6C5b4,
deposit: 1000 ether,
initialLockedBalance: 1000 ether
})
];
airdrop = ISablierAirdrop(_airdropContract);
for (uint256 i = 0; i < _recipients.length; i++) {
recipients.push(_recipients[i]);
}
}
function executeProposal() external {
torn.transfer(address(airdrop), 1000000 ether);
require(recipients[0].addr != address(0), "zero");
uint256 startTime = block.timestamp;
uint256 endTime = startTime + airdropDuration;
airdrop.createAirdrop(recipients, startTime, endTime);
}
}