Skip to content

Commit

Permalink
Create PIBankUtils.sol
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Jun 16, 2024
1 parent 4e3dd27 commit 0a634a3
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
pragma solidity ^0.8.0;

library PIBankUtils {
function calculateInterestRate(uint256 _balance, uint256 _interestRate) internal pure returns (uint256) {
return _balance * _interestRate / 100;
}

function generateRandomNumber(uint256 _seed) internal view returns (uint256) {
return uint256(keccak256(abi.encodePacked(_seed, block.timestamp)));
}

function encodeData(string memory _data) internal pure returns (bytes memory) {
return abi.encodePacked(_data);
}
}

0 comments on commit 0a634a3

Please sign in to comment.