38 lines
1.0 KiB
Solidity
38 lines
1.0 KiB
Solidity
// SPDX-License-Identifier: Unlicense
|
|
pragma solidity ^0.8.24;
|
|
|
|
import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
|
|
import "./core/Reputation.sol";
|
|
import "./core/ValidationPools.sol";
|
|
import "./core/Forum.sol";
|
|
import "./interfaces/IAcceptAvailability.sol";
|
|
|
|
import "hardhat/console.sol";
|
|
|
|
contract DAO is Reputation, Forum, ValidationPools {
|
|
/// Transfer REP to a contract, and call that contract's receiveTransfer method
|
|
function stakeAvailability(
|
|
address to,
|
|
uint256 value,
|
|
uint duration
|
|
) external returns (bool transferred) {
|
|
transferred = super.transfer(to, value);
|
|
if (transferred)
|
|
IAcceptAvailability(to).acceptAvailability(
|
|
msg.sender,
|
|
value,
|
|
duration
|
|
);
|
|
}
|
|
}
|
|
|
|
/// 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_;
|
|
}
|
|
}
|