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

Staker nft #56

Open
wants to merge 69 commits into
base: main
Choose a base branch
from
Open

Staker nft #56

wants to merge 69 commits into from

Conversation

elclandestin0
Copy link
Contributor

@elclandestin0 elclandestin0 commented Sep 4, 2024

Staker NFT new metadata

Files added:

  • DateTime.sol
    • The code is from another author, see @notice in file
    • Modified into a library
    • Modified solidity version

Files edited:

  • PositionMetadata.sol
    • Added new functions to generate svg on chain
  • Staker3.test.ts
    • Filled 1st test to spit out tokenURIs of all token types after staking according to their respective token type

Copy link
Contributor

@zomglings zomglings left a comment

Choose a reason for hiding this comment

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

Left some comments.

Copy link
Contributor

Choose a reason for hiding this comment

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

You need to also commit the corresponding changes to bindings/PositionMetadata/PositionMetadats.go.

Copy link
Contributor

Choose a reason for hiding this comment

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

This was taken from here: https://github.com/pipermerriam/ethereum-datetime/blob/master/contracts/DateTime.sol

But it has been taken without attribution. I am not ok with this. Either import it as a dependency or put a comment in this file explaining where the code was taken from.

Copy link
Contributor

Choose a reason for hiding this comment

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

I would prefer to import it - is there a reason we can't do so (e.g. solidity version issues in the original file)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fairpoint. Thanks for adding.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

From our slack conversation: it's best to keep our compiler uniform! The original file has 0.4.16

},
],
});
//#endregion
});

it('STAKER-114: The ERC721 representing a non-ERC721 staking position have as its metadata URI a data URI representing an appropriate JSON object', async function () {
Copy link
Contributor

Choose a reason for hiding this comment

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

What about this test? Maybe split STAKER-113 into 4 tests?

Copy link
Contributor Author

@elclandestin0 elclandestin0 Sep 4, 2024

Choose a reason for hiding this comment

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

Done:

  • Removed 1155, Native and 20 tests
  • Split the first 2 into their own tests since 20 is test STAKER-114

@elclandestin0 elclandestin0 marked this pull request as draft September 4, 2024 22:35
@elclandestin0 elclandestin0 marked this pull request as ready for review September 5, 2024 14:34
zomglings
zomglings previously approved these changes Sep 12, 2024
Copy link
Contributor

@zomglings zomglings left a comment

Choose a reason for hiding this comment

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

Approved, but I left some suggestions for improvement to make it easier on other reviewers. Nothing game breaking would be nice if you made those changes before you merged.

Copy link
Contributor

Choose a reason for hiding this comment

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

@elclandestin0 : Can you remove these changes from your branch? You should be able to do this using the following commands (not tested):

git checkout main -- bindings/WrappedNativeToken/WrappedNativeToken.go
git add bindings/WrappedNativeToken/WrappedNativeToken.go
git commit # type an appropriate commit message into your editor, and hit save

I assume you didn't touch the WrappedNativeToken contract so regenerating the bindings has no meaning.

Do this for all bindings you didn't touch, please.

Copy link
Contributor

Choose a reason for hiding this comment

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

These are the only bindings that should remain committed.


expect(metadata).to.deep.equal({
token_id: positionTokenID.toString(),
image: metadata.image,
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be good to read the expected value from the PositionMetadata contract, and check that the value for the image in the PositionMetdata contract is what is returned from the Staker contract when you call tokenURI.


it('STAKER-115: `CurrentAmountInPool` and `CurrentPositionsInPool` should accurate reflect the amount of tokens and number of positions currently open under a native token staking pool', async function () {
it('STAKER-117: `CurrentAmountInPool` and `CurrentPositionsInPool` should accurate reflect the amount of tokens and number of positions currently open under a native token staking pool', async function () {
Copy link
Contributor

Choose a reason for hiding this comment

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

@elclandestin0 : These numbering changes don't match the ones in the flows document.

I am ok with your changes -- maybe just delete the flows document. And let us also remove the graffiti tool. I think that whole system is more trouble than it's worth.

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