Skip to content
This repository has been archived by the owner on Jul 9, 2021. It is now read-only.

erc1155 minimal implementation #1657

Merged
merged 33 commits into from
Mar 12, 2019

Conversation

hysz
Copy link
Contributor

@hysz hysz commented Feb 27, 2019

Description

This was created for testing the ERC1155 proxy.

  • The implementation is derived from the ERC-1155 Reference Implementation.
  • Changes to reference implementation include: bug fixes / tests / style
  • Supports both fungible & non-fungible tokens

Testing instructions

Types of changes

Checklist:

  • Prefix PR title with [WIP] if necessary.
  • Add tests to cover changes as needed.
  • Update documentation as needed.
  • Add new entries to the relevant CHANGELOG.jsons.

@hysz hysz requested a review from abandeali1 February 27, 2019 22:20
@hysz hysz changed the title [WIP] erc1155 minimal implementation erc1155 minimal implementation Feb 27, 2019
@hysz hysz force-pushed the feature/contracts/erc1155MinimalImplementation branch 2 times, most recently from 9824e53 to d286556 Compare February 28, 2019 21:56
@coveralls
Copy link

coveralls commented Feb 28, 2019

Coverage Status

Coverage remained the same at 85.142% when pulling c53edf6 on feature/contracts/erc1155MinimalImplementation into 2822e77 on development.

@hysz hysz requested a review from dekz March 1, 2019 00:18
@hysz hysz force-pushed the feature/contracts/erc1155MinimalImplementation branch from 82cafd6 to 6fe5fed Compare March 5, 2019 19:37

// perform transfer
if (isNonFungible(id)) {
require(nfOwners[id] == from);
Copy link
Member

Choose a reason for hiding this comment

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

Should we require the value is 1 here?

                require(
                    value == 1,
                    "AMOUNT_EQUAL_TO_ONE_REQUIRED"
                );

nfOwners[id] = to;
} else {
balances[id][from] = safeSub(balances[id][from], value);
balances[id][to] = safeAdd(value, balances[id][to]);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
balances[id][to] = safeAdd(value, balances[id][to]);
balances[id][to] = safeAdd(balances[id][to], value);

token: BigNumber,
value: BigNumber,
callbackData: string = '0x',
delegatedSpender: string = '',
Copy link
Member

Choose a reason for hiding this comment

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

maybe set these to undefined/optional rather than empty string

@hysz hysz mentioned this pull request Mar 5, 2019
4 tasks
@hysz hysz force-pushed the feature/contracts/erc1155MinimalImplementation branch 3 times, most recently from 785f1c5 to 6fa806a Compare March 7, 2019 21:08
@hysz hysz requested a review from LogvinovLeon as a code owner March 7, 2019 22:06
@hysz hysz force-pushed the feature/contracts/erc1155MinimalImplementation branch from 272602e to 9b5199e Compare March 7, 2019 22:38
@hysz hysz force-pushed the feature/contracts/erc1155MinimalImplementation branch from 9b5199e to 9822792 Compare March 12, 2019 01:25
@hysz hysz merged commit 667c221 into development Mar 12, 2019
@hysz hysz deleted the feature/contracts/erc1155MinimalImplementation branch March 16, 2019 04:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants