-
Notifications
You must be signed in to change notification settings - Fork 0
/
functionToHEX
23 lines (22 loc) · 1.16 KB
/
functionToHEX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// SPDX-License-Identifier: MIT
pragma solidity 0.8.16;
contract enc {
function encodeCreate(string memory _msg) public pure returns (bytes memory){
return (abi.encodeWithSignature("createDeal(string)", _msg));
}
function encodeAbort(uint _dealNumber) public pure returns (bytes memory){
return (abi.encodeWithSignature("abort(uint256)", _dealNumber));
}
function encodePurchase(uint _dealNumber, string memory _msg) public pure returns (bytes memory){
return (abi.encodeWithSignature("confirmPurchase(uint256,string)", _dealNumber, _msg));
}
function encodeConfirm(uint _dealNumber) public pure returns (bytes memory){
return (abi.encodeWithSignature("confirmReceived(uint256)", _dealNumber));
}
function encodeCreateUSDT(string memory _msg, uint _amount) public pure returns (bytes memory){
return (abi.encodeWithSignature("createDeal(string,uint256)", _msg, _amount));
}
function encodePurchaseUSDT(uint _dealNumber, string memory _msg, uint _amount) public pure returns (bytes memory){
return (abi.encodeWithSignature("confirmPurchase(uint256,string,uint256)", _dealNumber, _msg, _amount));
}
}