From a4c65fcb8e6cf9cf2182ba9180c687ffd966191c Mon Sep 17 00:00:00 2001 From: Emmanuel Date: Mon, 20 Feb 2023 15:06:16 -0300 Subject: [PATCH] lib cleaning by removing TODOs (#247) --- contracts/v0.8/AccountAPI.sol | 4 ---- contracts/v0.8/InitAPI.sol | 2 -- contracts/v0.8/MinerAPI.sol | 16 ---------------- contracts/v0.8/SendAPI.sol | 3 +-- contracts/v0.8/cbor/BigIntCbor.sol | 4 ---- 5 files changed, 1 insertion(+), 28 deletions(-) diff --git a/contracts/v0.8/AccountAPI.sol b/contracts/v0.8/AccountAPI.sol index 1f4d41fd..b84630f7 100644 --- a/contracts/v0.8/AccountAPI.sol +++ b/contracts/v0.8/AccountAPI.sol @@ -31,7 +31,6 @@ library AccountAPI { using AccountCBOR for *; using BytesCBOR for bytes; - /// @notice TODO fill this a proper description /// @param target The account address (filecoin bytes format) you want to interact with function authenticateMessage(bytes memory target, AccountTypes.AuthenticateMessageParams memory params) internal { bytes memory raw_request = params.serializeAuthenticateMessageParams(); @@ -42,7 +41,6 @@ library AccountAPI { require(result.length == 0, "unexpected response received"); } - /// @notice TODO fill this a proper description /// @param target The account actor id you want to interact with function authenticateMessage(uint64 target, AccountTypes.AuthenticateMessageParams memory params) internal { bytes memory raw_request = params.serializeAuthenticateMessageParams(); @@ -53,7 +51,6 @@ library AccountAPI { require(result.length == 0, "unexpected response received"); } - /// @notice TODO fill this a proper description /// @param target The account address (filecoin bytes format) you want to interact with function universalReceiverHook(bytes memory target, AccountTypes.UniversalReceiverParams memory params) internal { bytes memory raw_request = params.serializeUniversalReceiverParams(); @@ -64,7 +61,6 @@ library AccountAPI { require(result.length == 0, "unexpected response received"); } - /// @notice TODO fill this a proper description /// @param target The account actor id you want to interact with function universalReceiverHook(uint64 target, AccountTypes.UniversalReceiverParams memory params) internal { bytes memory raw_request = params.serializeUniversalReceiverParams(); diff --git a/contracts/v0.8/InitAPI.sol b/contracts/v0.8/InitAPI.sol index 018f87fd..a20360c8 100644 --- a/contracts/v0.8/InitAPI.sol +++ b/contracts/v0.8/InitAPI.sol @@ -29,7 +29,6 @@ import "./utils/Actor.sol"; library InitAPI { using InitCBOR for *; - /// @notice TODO fill this a proper description function exec(InitTypes.ExecParams memory params) internal returns (InitTypes.ExecReturn memory) { bytes memory raw_request = params.serializeExecParams(); @@ -40,7 +39,6 @@ library InitAPI { return result.deserializeExecReturn(); } - /// @notice TODO fill this a proper description function exec4(InitTypes.Exec4Params memory params) internal returns (InitTypes.Exec4Return memory) { bytes memory raw_request = params.serializeExec4Params(); diff --git a/contracts/v0.8/MinerAPI.sol b/contracts/v0.8/MinerAPI.sol index 9d293439..06d71fbb 100644 --- a/contracts/v0.8/MinerAPI.sol +++ b/contracts/v0.8/MinerAPI.sol @@ -243,7 +243,6 @@ library MinerAPI { return result.deserializeGetBeneficiaryReturn(); } - /// @notice TODO fill me up /// @param target The miner address (filecoin bytes format) you want to interact with function changeWorkerAddress(bytes memory target, MinerTypes.ChangeWorkerAddressParams memory params) internal { bytes memory raw_request = params.serializeChangeWorkerAddressParams(); @@ -254,7 +253,6 @@ library MinerAPI { require(result.length == 0, "unexpected response received"); } - /// @notice TODO fill me up /// @param target The miner actor id you want to interact with function changeWorkerAddress(uint64 target, MinerTypes.ChangeWorkerAddressParams memory params) internal { bytes memory raw_request = params.serializeChangeWorkerAddressParams(); @@ -265,7 +263,6 @@ library MinerAPI { require(result.length == 0, "unexpected response received"); } - /// @notice TODO fill me up /// @param target The miner address (filecoin bytes format) you want to interact with function changePeerId(bytes memory target, MinerTypes.ChangePeerIDParams memory params) internal { bytes memory raw_request = params.serializeChangePeerIDParams(); @@ -276,7 +273,6 @@ library MinerAPI { require(result.length == 0, "unexpected response received"); } - /// @notice TODO fill me up /// @param target The miner actor id you want to interact with function changePeerId(uint64 target, MinerTypes.ChangePeerIDParams memory params) internal { bytes memory raw_request = params.serializeChangePeerIDParams(); @@ -287,7 +283,6 @@ library MinerAPI { require(result.length == 0, "unexpected response received"); } - /// @notice TODO fill me up /// @param target The miner address (filecoin bytes format) you want to interact with function changeMultiaddresses(bytes memory target, MinerTypes.ChangeMultiaddrsParams memory params) internal { bytes memory raw_request = params.serializeChangeMultiaddrsParams(); @@ -298,7 +293,6 @@ library MinerAPI { require(result.length == 0, "unexpected response received"); } - /// @notice TODO fill me up /// @param target The miner actor id you want to interact with function changeMultiaddresses(uint64 target, MinerTypes.ChangeMultiaddrsParams memory params) internal { bytes memory raw_request = params.serializeChangeMultiaddrsParams(); @@ -309,7 +303,6 @@ library MinerAPI { require(result.length == 0, "unexpected response received"); } - /// @notice TODO fill me up /// @param target The miner address (filecoin bytes format) you want to interact with function repayDebt(bytes memory target) internal { bytes memory raw_request = new bytes(0); @@ -320,7 +313,6 @@ library MinerAPI { require(result.length == 0, "unexpected response received"); } - /// @notice TODO fill me up /// @param target The miner actor id you want to interact with function repayDebt(uint64 target) internal { bytes memory raw_request = new bytes(0); @@ -331,7 +323,6 @@ library MinerAPI { require(result.length == 0, "unexpected response received"); } - /// @notice TODO fill me up /// @param target The miner address (filecoin bytes format) you want to interact with function confirmChangeWorkerAddress(bytes memory target) internal { bytes memory raw_request = new bytes(0); @@ -342,7 +333,6 @@ library MinerAPI { require(result.length == 0, "unexpected response received"); } - /// @notice TODO fill me up /// @param target The miner actor id you want to interact with function confirmChangeWorkerAddress(uint64 target) internal { bytes memory raw_request = new bytes(0); @@ -353,7 +343,6 @@ library MinerAPI { require(result.length == 0, "unexpected response received"); } - /// @notice TODO fill me up /// @param target The miner address (filecoin bytes format) you want to interact with function getPeerId(bytes memory target) internal returns (MinerTypes.GetPeerIDReturn memory) { bytes memory raw_request = new bytes(0); @@ -365,7 +354,6 @@ library MinerAPI { return result.deserializeGetPeerIDReturn(); } - /// @notice TODO fill me up /// @param target The miner actor id you want to interact with function getPeerId(uint64 target) internal returns (MinerTypes.GetPeerIDReturn memory) { bytes memory raw_request = new bytes(0); @@ -377,7 +365,6 @@ library MinerAPI { return result.deserializeGetPeerIDReturn(); } - /// @notice TODO fill me up /// @param target The miner address (filecoin bytes format) you want to interact with function getMultiaddresses(bytes memory target) internal returns (MinerTypes.GetMultiaddrsReturn memory) { bytes memory raw_request = new bytes(0); @@ -389,7 +376,6 @@ library MinerAPI { return result.deserializeGetMultiaddrsReturn(); } - /// @notice TODO fill me up /// @param target The miner actor id you want to interact with function getMultiaddresses(uint64 target) internal returns (MinerTypes.GetMultiaddrsReturn memory) { bytes memory raw_request = new bytes(0); @@ -401,7 +387,6 @@ library MinerAPI { return result.deserializeGetMultiaddrsReturn(); } - /// @notice TODO fill me up /// @param target The miner address (filecoin bytes format) you want to interact with /// @param params the amount you want to withdraw function withdrawBalance(bytes memory target, MinerTypes.WithdrawBalanceParams memory params) internal returns (MinerTypes.WithdrawBalanceReturn memory) { @@ -414,7 +399,6 @@ library MinerAPI { return result.deserializeWithdrawBalanceReturn(); } - /// @notice TODO fill me up /// @param target The miner actor id you want to interact with /// @param params the amount you want to withdraw function withdrawBalance(uint64 target, MinerTypes.WithdrawBalanceParams memory params) internal returns (MinerTypes.WithdrawBalanceReturn memory) { diff --git a/contracts/v0.8/SendAPI.sol b/contracts/v0.8/SendAPI.sol index 74d5b6af..74cace14 100644 --- a/contracts/v0.8/SendAPI.sol +++ b/contracts/v0.8/SendAPI.sol @@ -22,10 +22,9 @@ pragma solidity ^0.8.17; import "./utils/Misc.sol"; import "./utils/Actor.sol"; -/// @title TODO complete me +/// @title This library is helper method to send funds to some specfici address. Calling one of its methods will result in a cross-actor call being performed. /// @author Zondax AG library SendAPI { - /// @notice TODO fill this a proper description /// @param toAddress The address (filecoin bytes format) you want to send funds to function send(bytes memory toAddress, uint256 amount) internal { bytes memory rawResponse = Actor.call(0, toAddress, new bytes(0), Misc.NONE_CODEC, amount, false); diff --git a/contracts/v0.8/cbor/BigIntCbor.sol b/contracts/v0.8/cbor/BigIntCbor.sol index b55504e6..278582b4 100644 --- a/contracts/v0.8/cbor/BigIntCbor.sol +++ b/contracts/v0.8/cbor/BigIntCbor.sol @@ -26,7 +26,6 @@ struct BigInt { library BigIntCBOR { function serializeBigInt(BigInt memory num) internal pure returns (bytes memory) { - // TODO improve gas efficiency by using assembly code bytes memory raw = new bytes(num.val.length + 1); if (num.neg) { @@ -43,9 +42,6 @@ library BigIntCBOR { } function deserializeBigInt(bytes memory raw) internal pure returns (BigInt memory) { - // TODO improve gas efficiency by using assembly code - - // Is an empty byte a valid BigInt ? We should have the sign byte at least if (raw.length == 0) { return BigInt(hex"00", false); }