2024-03-04 19:33:06 -06:00
|
|
|
// SPDX-License-Identifier: Unlicense
|
|
|
|
pragma solidity ^0.8.24;
|
|
|
|
|
2024-03-10 12:57:30 -05:00
|
|
|
import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
|
2024-04-09 05:33:04 -05:00
|
|
|
import "./core/Reputation.sol";
|
|
|
|
import "./core/ValidationPools.sol";
|
|
|
|
import "./core/Forum.sol";
|
|
|
|
import "./interfaces/IAcceptAvailability.sol";
|
2024-03-11 13:39:56 -05:00
|
|
|
import "hardhat/console.sol";
|
|
|
|
|
2024-04-09 20:50:04 -05:00
|
|
|
// TODO: consider dynamically constructing contract instances rather than merging at build time
|
2024-04-09 05:33:04 -05:00
|
|
|
contract DAO is Reputation, Forum, ValidationPools {
|
2024-03-10 22:29:51 -05:00
|
|
|
/// Transfer REP to a contract, and call that contract's receiveTransfer method
|
|
|
|
function stakeAvailability(
|
|
|
|
address to,
|
|
|
|
uint256 value,
|
|
|
|
uint duration
|
2024-04-09 20:50:04 -05:00
|
|
|
) external returns (bool) {
|
|
|
|
_approve(msg.sender, to, value);
|
|
|
|
IAcceptAvailability(to).acceptAvailability(msg.sender, value, duration);
|
|
|
|
return true;
|
2024-03-10 22:29:51 -05:00
|
|
|
}
|
2024-03-04 19:33:06 -06:00
|
|
|
}
|
2024-03-26 18:28:38 -05:00
|
|
|
|
|
|
|
/// Convenience contract to extend for other contracts that will be initialized to
|
|
|
|
/// interact with a DAO contract.
|
|
|
|
contract DAOContract {
|
|
|
|
DAO immutable dao;
|
|
|
|
|
|
|
|
constructor(DAO dao_) {
|
|
|
|
dao = dao_;
|
|
|
|
}
|
|
|
|
}
|