Zondax / filecoin-solidity

Filecoin Solidity API Library
Apache License 2.0
95 stars 43 forks source link

More instances of bytes vs id addresses in inputs and Structs #287

Closed snissn closed 1 year ago

snissn commented 1 year ago

263 for background.

Many of the types / structs being used specify the type of filecoin address variables in bytes. For example: in DataCapAPI.burnFrom DataCapAPI.sol calls by address into DataCapTypes.ActorID -> DataCapTypes.BurnFromMethodNum with params:

   struct BurnFromParams {
        bytes owner;
        BigInt amount;
    }

so a solidity user will need to construct bytes owner. Can this be moved to a filecoin id?

Below is a non exhaustive list of such parameters that can be changed:

MinerAPI.sol

DataCapAPI.sol

MarketAPI.sol

Precompiles.sol

SendAPI.sol

types/AccountTypes.sol

types/InitTypes.sol

types/MarketTypes.sol

types/MinerTypes.sol

types/PowerTypes.sol

types/VerifRegTypes.sol

:link: zboto Link

emmanuelm41 commented 1 year ago

@snissn this could be something interesting to do if we first create some kind of utility functions to handle filecoin addresses on solidity (check, convert from string to bytes, from bytes to string, etc). Until we don't have something like that, it will be impossible to do it.

emmanuelm41 commented 1 year ago

Depends on #241