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

Allow creating token pools from an existing ERC1155 contract #123

Merged
merged 10 commits into from
May 31, 2023

Conversation

awrichar
Copy link
Contributor

@awrichar awrichar commented May 12, 2023

Pools on ERC1155 are really just ranges of the token ID space. Going forward,
all pools will be expressed with a startId and endId. This makes the service
logic much less bound to the specific decisions made in the sample contract
around partitioning it in chunks of exactly 2^128.

These startId and endId params can also be passed in on config (in
addition to address) when creating a token pool, which will generate and
return pool details immediately instead of expecting to call a create method.

The old poolId format such as "F1" or "N2" will still be parsed as expected,
but will not be attached to any new pools.

Fixes #104
Fixes #98

Breaking Change
There is a minor breaking change in that info.typeId on a token pool has
been replaced with info.startId for consistency. Any applications that happen
to rely on this field will need to change to the new spelling.

Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
@awrichar awrichar force-pushed the pool-id branch 2 times, most recently from b562df3 to f29a911 Compare May 12, 2023 19:45
Pools on ERC1155 are really just ranges of the token ID space. Going forward,
all pools will be expressed with a startId and endId. This makes the service
logic much less bound to the specific decisions made in the sample contract
around partitioning it in chunks of exactly 2^128.

The old poolId format such as "F1" or "N2" will still be parsed as expected,
but will not be attached to any new pools.

Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
@awrichar awrichar changed the title Drop narrow "poolId" formatting in favor of "startId/endId" Allow creating token pools from an existing ERC1155 contract May 15, 2023
Must specify the contract address, along with a startId and endId for a
range of token IDs to form the pool.

Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
@@ -105,7 +105,7 @@ export class BlockchainConnectorService {
// Check if retry condition matches the err that's been hit
private matchesRetryCondition(err: any): boolean {
return (
this.retryConfiguration.retryCondition != '' &&
this.retryConfiguration.retryCondition !== '' &&
Copy link
Member

Choose a reason for hiding this comment

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

❤️

@awrichar awrichar merged commit 321cf68 into hyperledger:main May 31, 2023
@awrichar awrichar deleted the pool-id branch May 31, 2023 17:52
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.

Support indexing pre-existing token contracts Add support for ERC1155 contracts generated by OpenZeppelin
2 participants