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

feat: smart contract setTokenVerified calls through ethers #272

Merged
merged 14 commits into from
Jun 9, 2023

Conversation

EmperorOrokuSaki
Copy link
Collaborator

@EmperorOrokuSaki EmperorOrokuSaki commented Jun 5, 2023

Serverless Update:

-> The ethers library migration is completed. This was the only major remaining task. Now, handlers can submit transactions to networks in order to verify each token (both build and mint handlers do this)

Possible future enhancements:

-> I have made some minor changes to the Prisma config file and helper library. With the new changes we should see only error and warning logs from Prisma Client (doesn't seem to work though, I still see queries). Would be cool to look into it during the cleaning phase.

-> Right now, the gas cost is comfortably hard-coded. I don't think we are ever going to need more than what I have set currently, but we also need to take the network status into account. It would be cool to look into how we can set the gas costs and priority fees automatically based on the current network status.

-> Overall not an important task but we might want to load the ABI from our contracts directory with the latest deployments. The serverless side currently has it's own copy of the ABI. In the end, it is always going to need that copy because it's packed into the libs layer and uploaded to aws. Also considering the fact that we do deployments to goerli, main-net, and mumbai, it's going to be tricky to decide which one to use. I think the current implementation handles the job very well and I don't think we should change it. But wanted to mention just in case somebody else has a different idea.

@EmperorOrokuSaki EmperorOrokuSaki added enhancement New feature or request backend refactor Improve existing feature labels Jun 5, 2023
@EmperorOrokuSaki EmperorOrokuSaki added this to the MVP milestone Jun 5, 2023
@EmperorOrokuSaki EmperorOrokuSaki self-assigned this Jun 5, 2023
@shortcut-integration
Copy link

…ingly, customize prisma logs, update the config files to match the changes.
@EmperorOrokuSaki EmperorOrokuSaki requested a review from zoruka June 7, 2023 19:44
Copy link
Contributor

@zoruka zoruka left a comment

Choose a reason for hiding this comment

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

It looks good to me. Related to #266. I would request @jsonsivar to eyeball these.

Comment on lines 90 to 93
apiKey: {
polygonMumbai: POLYGONSCAN_KEY,
},
// apiKey: ETHERSCAN_API_KEY ? ETHERSCAN_API_KEY : '',
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe we can set this for both networks? (same from one previous pr 🤔)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I updated the previous pr. But since this is going to be merged after, I'll update it here too

@@ -37,6 37,8 @@ export const submitBuildInfo = async (
domain: buildInfo.domain,
},
});
console.log(buildRecord);
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe leftover

Comment on lines 5 to 10
if (
process.env.PRIVATE_KEY === undefined ||
process.env.JSON_RPC === undefined ||
process.env.CONTRACT_ADDRESS === undefined
) {
throw Error('Private key or the JSON RPC environment variable not set.');
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 split this in different conditions and throw different error messages.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

agreed

/bin/bash ./scripts/prepare-node-modules-lambda-layer.sh

echo "${bold}Deploying to AWS lambda${normal}"
yarn sls deploy --stage dev --verbose
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we parameterize the --stage so we can cal it with dev or prd in the future.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added support for the flag

timestamp: true
ipfsHash: true
tokenId: true
environment: # TODO They won't be loaded from the shell environment, need to find a way to pass them from the deployment script
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't worry, we should just save the values in AWS Parameter Store and then point to them from the next lines.

@EmperorOrokuSaki EmperorOrokuSaki merged commit bbe73f4 into develop Jun 9, 2023
@EmperorOrokuSaki EmperorOrokuSaki deleted the feat/sc-927/ethers-lib branch June 9, 2023 18:53
@EmperorOrokuSaki EmperorOrokuSaki mentioned this pull request Jul 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend enhancement New feature or request refactor Improve existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants