create Library for Bytes32 - String Conversion functions #1

Closed
opened 2024-05-06 23:26:05 +00:00 by p1r0 · 1 comment
Owner

Create the library

Add the following methods(signature shown code1.) form the test and script,
to a library.

    function Bytes32PairToString(bytes32 part1, bytes32 part2) public pure returns (string memory) 

    function stringToBytes32Pair(string memory source) public pure returns (bytes32 part1, bytes32 part2) 

ToDo

  • Create the library with methods
  • Update the testing scripts to test it works
  • Update the deployement script

Future Work

  • integrate the library to natively operate on the dapps mapping.

References

  1. Smart Contract Programmer, Library | Solidity 0.8, 2024-05-06.
  2. Solidity By Example, Library,2024-05-06.
## Create the library Add the following methods(signature shown code1.) form the test and script, to a library. ```solidity function Bytes32PairToString(bytes32 part1, bytes32 part2) public pure returns (string memory) function stringToBytes32Pair(string memory source) public pure returns (bytes32 part1, bytes32 part2) ``` ## ToDo - [x] Create the library with methods - [x] Update the testing scripts to test it works - [x] Update the deployement script ## Future Work - [ ] integrate the library to natively operate on the dapps mapping. ## References 1. Smart Contract Programmer, [Library | Solidity 0.8](https://www.youtube.com/watch?v=OH5mafV6jVE), 2024-05-06. 2. Solidity By Example, [Library](https://solidity-by-example.org/library/),2024-05-06.
Author
Owner

Solved on PR #5

Solved on PR #5
p1r0 closed this issue 2024-05-09 01:27:26 +00:00
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: DecentralizedScience/dapp_indexer#1
No description provided.