Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nft transfers #311

Merged
merged 14 commits into from
Dec 3, 2021
Merged

Nft transfers #311

merged 14 commits into from
Dec 3, 2021

Conversation

schmanu
Copy link
Collaborator

@schmanu schmanu commented Nov 30, 2021

After some work on this, the first version is done.

It includes:

  • new combined CSV File for ERC20, ERC721, ERC1155 and native token transfers
  • token_type column controls which kind of validation / transformation rules will be applied to each row
  • redesign of summary tables into accordions. One table for assets, one table for collectibles
  • updated help dialogue
  • unit tests for collectible validation / parsing / transformation / transfers

Here is a transaction I submitted including erc20, erc1155 and native tokens:
https://rinkeby.etherscan.io/tx/0x158e3794c672ad550726477d5c12fa6cfc90c0fbddf0cffeb2062b07ee0b7f89

Screenshot:
Screenshot 2021-11-30 at 23-41-48 Gnosis Safe

I didn't try it on mainnet yet, because I don't have a safe there.

NEW UI:
* Tab-Navigation to fill out a CSV for Asset-Transfers or Collectible-Transfers
* transfer-tables are now always displayed under the CSV-Form.
* there are now two tables: For asset transfers and for collectible transfers
* submit button is at the bottom of these tables

issue #16
* one combined CSV file for nft / asset transfers
* tables are wrapped in accordions
* Updates help text
* Validates, that the value is a integer for erc1155 transfers
* unittests for the transfer of collectibles
* unittest for decimal (invalid) erc1155
* fixes sample file
Copy link
Owner

@bh2smith bh2smith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome. I still need to try it out, but it looks swell. Some nits, comments and suggestions inline.

package.json Outdated Show resolved Hide resolved
public/sample.csv Show resolved Hide resolved
public/sample.csv Show resolved Hide resolved
src/components/FAQModal.tsx Outdated Show resolved Hide resolved
<code>
<b>token_address</b>
</code>
: Ethereum address of ERC20 token to be transferred. This has to be left blank for native (ETH)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit

Suggested change
: Ethereum address of ERC20 token to be transferred. This has to be left blank for native (ETH)
: Ethereum address of ERC20 token to be transferred. This must be left blank for native (ETH)

</Title>
<Text size="lg">
Since native tokens do not have a token address, you must leave the <code>token_address</code> column
blank for native transfers.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
blank for native transfers.
blank for native transfers. See the sample transfer file for an example of this.

src/components/assets/ERC721Token.tsx Outdated Show resolved Hide resolved
export const transform = (
row: CSVRow,
tokenInfoProvider: TokenInfoProvider,
erc721InfoProvider: ERC721InfoProvider,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NFT info provider?

Comment on lines +12 to +14
case "erc1155":
case "erc721":
validateCollectibleRow(row, callback);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am new to TS switches, but I'm guessing this means both cases are validated and not that one is skipped.

* instead of providing erc1155/erc721 the token_type now is simply nft
* fixes performance problem of editor. For no reason the csvContent was held by the App and passed down to the editor
* tests for nft transfers
* updated faq
@bh2smith
Copy link
Owner

bh2smith commented Dec 3, 2021

We should deploy a new version of this, get the ipfs hash and share it with the people interested in this feature.

@bh2smith bh2smith merged commit 86de397 into master Dec 3, 2021
@bh2smith bh2smith deleted the nft-transfers branch December 3, 2021 10:42
transfer.from,
transfer.receiver,
transfer.tokenId.toFixed(),
transfer.value?.toFixed() ?? "0",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the default here should be "1" and not "0". Because ERC1155 tokens have a balanceOf for a single ID.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants