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

Production: Implement better factor contract pattern #30

Open
freelerobot opened this issue Apr 15, 2022 · 2 comments
Open

Production: Implement better factor contract pattern #30

freelerobot opened this issue Apr 15, 2022 · 2 comments

Comments

@freelerobot
Copy link
Collaborator

freelerobot commented Apr 15, 2022

Problem: the plugin references a single, static, nonchangeable smart contract address.

But each DF game is a new smart contract address, and our plugin depends on the respective DF contract addresses.

Potential solutions:

  • Create a Nightmarket global factory contract which spins out a new Nightmarket contract for each new DF game contract. Enable this feature in game. A bit frictioned since one player will have to deploy new nightmarket contracts for each game.
  • Rewrite Nightmarket contracts to work with all Darkforest games. It queries any address. The plugin instantiates the NightMarket contract with the DF contract address used for mappings/data lookups. Not super elegant, potential security issues.
  • Open to potential, better solutions, I haven't thought about this too deeply.
@freelerobot freelerobot changed the title nice to have: factory pattern this contract factory contract: users can use plugin to deploy contract for round Apr 22, 2022
@freelerobot
Copy link
Collaborator Author

const Greeter = await ethers.getContractFactory("Greeter");
already providedd by ethers... so easy

@freelerobot freelerobot changed the title factory contract: users can use plugin to deploy contract for round Production: Implement better factor contract pattern Jun 10, 2022
@dmpierre
Copy link
Contributor

For now, a nightmarket factory contract has been implemented. See contracts/NightMarketFactory.sol

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

No branches or pull requests

2 participants