Skip to content

Commit

Permalink
fix: Add contract to handle IOU
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelmtzinf committed Apr 30, 2024
1 parent 62ff487 commit 8e78312
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions contracts/src/v0.8/ccip/pools/GhoIOU.sol
Original file line number Diff line number Diff line change
@@ -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
}
}

0 comments on commit 8e78312

Please sign in to comment.