Skip to content

Commit

Permalink
Updated version 18
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Feb 16, 2025
1 parent 838b84e commit 6c3ca23
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 24 deletions.
4 changes: 1 addition & 3 deletions contracts/PercentUtility.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ contract PercentUtility is
using SafeMath for uint256;


/// @inheritdoc IPercentUtility
uint256 public constant override PERCENT_DIVISOR = 10_000;
/// @inheritdoc IPercentUtility
uint256 public constant override PERCENT_ONE_HUNDRED = 10_000;

Expand All @@ -26,7 +24,7 @@ contract PercentUtility is
override
returns (uint256)
{
return _a.mul(_percent).div(PERCENT_DIVISOR);
return _a.mul(_percent).div(PERCENT_ONE_HUNDRED);
}

/// @inheritdoc IPercentUtility
Expand Down
11 changes: 0 additions & 11 deletions contracts/interface/IPercentUtility.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,6 @@ pragma solidity ^0.8.18;

interface IPercentUtility
{
/**
* @dev [view-uint256]
* @notice Divisor
* @return {uint256}
*/
function PERCENT_DIVISOR()
external
view
returns (uint256)
;

/**
* @dev [view-uint256]
* @notice One Hundred Percent
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@yield-sync/utility",
"version": "0.0.17",
"version": "0.0.18",
"description": "Refer to README.md",
"main": "",
"scripts": {
Expand Down
11 changes: 2 additions & 9 deletions test/PercentUtility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,6 @@ async function deployContract(_contractFactory: string, params: any[] = []): Pro
describe("PercentUtility.sol", async () => {
let percentUtility: Contract;

let DIVISOR: number = 10_000;
let ONE_HUNDRED_PERCENT: number = 10_000;

let owner: VoidSigner;
let manager: VoidSigner;


beforeEach("[beforeEach] Set up contracts..", async () => {
percentUtility = await deployContract("PercentUtility");
Expand All @@ -46,8 +40,7 @@ describe("PercentUtility.sol", async () => {

describe("contructor", async () => {
it("Should have values set correctly..", async () => {
expect(await percentUtility.ONE_HUNDRED_PERCENT()).to.be.equal(ONE_HUNDRED_PERCENT);
expect(await percentUtility.DIVISOR()).to.be.equal(DIVISOR);
expect(await percentUtility.PERCENT_ONE_HUNDRED()).to.be.equal(10_000);
});
});

Expand Down Expand Up @@ -141,7 +134,7 @@ describe("PercentUtility.sol", async () => {
{
amountA: ethers.utils.parseUnits("1", 18),
amountB: ethers.utils.parseUnits("1", 18),
expectedPercent: ONE_HUNDRED_PERCENT,
expectedPercent: await percentUtility.PERCENT_ONE_HUNDRED(),
},
{
amountA: ethers.utils.parseUnits("5234.23", 18),
Expand Down

0 comments on commit 6c3ca23

Please sign in to comment.