-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* tests of library functions * mock contract for lib * remove consoles * type tests * final type test * PR comments * PR comments
- Loading branch information
Showing
3 changed files
with
129 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.20; | ||
|
||
import {Currency, CurrencyLibrary} from "../types/Currency.sol"; | ||
|
||
contract CurrencyTest { | ||
function transfer(Currency currency, address to, uint256 amount) external { | ||
CurrencyLibrary.transfer(currency, to, amount); | ||
} | ||
|
||
function balanceOfSelf(Currency currency) external view returns (uint256) { | ||
return CurrencyLibrary.balanceOfSelf(currency); | ||
} | ||
|
||
function balanceOf(Currency currency, address owner) external view returns (uint256) { | ||
return CurrencyLibrary.balanceOf(currency, owner); | ||
} | ||
|
||
function isNative(Currency currency) external pure returns (bool) { | ||
return CurrencyLibrary.isNative(currency); | ||
} | ||
|
||
function toId(Currency currency) external pure returns (uint256) { | ||
return CurrencyLibrary.toId(currency); | ||
} | ||
|
||
function fromId(uint256 id) external pure returns (Currency) { | ||
return CurrencyLibrary.fromId(id); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters