From 8e783126d92743b6d1eb5d748594cd7f83041ceb Mon Sep 17 00:00:00 2001 From: miguelmtzinf Date: Tue, 30 Apr 2024 13:32:09 +0200 Subject: [PATCH] fix: Add contract to handle IOU --- contracts/src/v0.8/ccip/pools/GhoIOU.sol | 34 ++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 contracts/src/v0.8/ccip/pools/GhoIOU.sol diff --git a/contracts/src/v0.8/ccip/pools/GhoIOU.sol b/contracts/src/v0.8/ccip/pools/GhoIOU.sol new file mode 100644 index 0000000000..25600d8a7e --- /dev/null +++ b/contracts/src/v0.8/ccip/pools/GhoIOU.sol @@ -0,0 +1,34 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.0; + +import {ITypeAndVersion} from "../../shared/interfaces/ITypeAndVersion.sol"; +import {ILiquidityContainer} from "../../rebalancer/interfaces/ILiquidityContainer.sol"; + +import {TokenPool} from "./TokenPool.sol"; +import {RateLimiter} from "../libraries/RateLimiter.sol"; + +import {IERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; +import {SafeERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/utils/SafeERC20.sol"; + +import {console2} from "forge-std/console2.sol"; + +contract GhoIOU { // TODO: Upgradeable + mapping(address => uint256) pendingBalance; + + function setPendingBalance(address user, uint256 amount) public { + // TODO: onlyOwner + pendingBalance[user] = amount; + + // TODO: event + } + + function getPendingBalance(address user) public view returns (uint256) { + return pendingBalance[user]; + } + + function sendIOU() public { + // TODO: Send arbitrary message to destination TokenPool + // This must pay with feeToken (native or LINK for now) + // TODO: check supported network + } +}