简体   繁体   English

我如何为 NFT 游戏开发一个 solidity 的 auto-staker?

[英]How do I develop an auto-staker for an NFT game with solidity?

I'm relatively new to solidity development and coding in general, but I'd really like to try and write a program that stakes and un-stakes an NFT after 24 hours.一般来说,我对 solidity 开发和编码还比较陌生,但我真的很想尝试编写一个程序,在 24 小时后抵押和取消抵押 NFT。

Some background:一些背景:

I'm really into the Crypto Unicorns NFT pet collecting game right now, and there's a mini game called the " Dark Forest ."我现在非常喜欢Crypto Unicorns NFT 宠物收集游戏,还有一款名为“黑暗森林”的小游戏。 The idea behind the Dark Forest mini game is pretty simple: you send your Unicorn NFT into the Dark Forest (by staking the unicorn NFT), and then after 24 hours, your unicorn comes back with items.黑暗森林迷你游戏背后的想法非常简单:您将独角兽 NFT 发送到黑暗森林(通过抵押独角兽 NFT),然后 24 小时后,您的独角兽会带着物品回来。 The only thing is, you have to manually un-stake your unicorn to receive rewards, and then if you wanted to send your unicorn back in the Dark Forest a second time, you would have to do that manually as well.唯一的问题是,你必须手动取消你的独角兽的抵押才能获得奖励,然后如果你想再次将你的独角兽送回黑暗森林,你也必须手动完成。

Is there a way I could automate this process (un-staking, and then re-staking the unicorn NFT after 24 hours) and create some sort of "auto-staker" using solidity?有没有一种方法可以使这个过程自动化(取消质押,然后在 24 小时后重新质押独角兽 NFT)并使用 solidity 创建某种“自动质押者”? Or would this automation be better handled by some other language like python or java?或者这种自动化会更好地由其他语言处理,如 python 或 java?

Any guidance here would be awesome, as I don't really know where to start.这里的任何指导都会很棒,因为我真的不知道从哪里开始。 Guidance is especially needed regarding testing the program, since I don't actually own a unicorn NFT.关于测试程序尤其需要指导,因为我实际上并不拥有独角兽 NFT。 I'm mainly just trying to develop this quality of life program for broader Crypto Unicorns community.我主要只是想为更广泛的 Crypto Unicorns 社区开发这种生活质量计划。

Smart Contracts cant automate other Smart Contracts which is why we need central servers to do it for us.智能合约不能使其他智能合约自动化,这就是为什么我们需要中央服务器为我们做这件事。

Solutions解决方案

  • Use OpenZeppelin Defender - Smart Contract Automation UI使用 OpenZeppelin Defender - 智能合约自动化 UI
  • Use a node provider and create a script that listens to the stake contracts events to automate the process:>使用节点提供者并创建一个脚本来侦听股权合约事件以自动化该过程:>

Here is a blockchain node provider use-case code implementation github:>这是一个区块链节点提供者用例代码实现 github:>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何自动更新站点RSS提要 - How do I auto update a site RSS feed 如何在 Google 电子表格中创建自动清除脚本? - How do I create an Auto-Clear Script in a Google Spreadsheet? 如何将AndroidViewClient与eclipse集成以及如何开发测试 - How to integrate AndroidViewClient with eclipse and how to develop tests Microsoft Excel-如何自动在列中填充公式? - Microsoft Excel - How do you auto-populate a formula in a column? 如何为Java创建或编码以自动递增电子邮件 - How can I create or code to auto increment email, for java 如何使用 python 使 cursor 在游戏中移动(例如:第一射击游戏) - How can I make the cursor move in game using python (ex: First shooter shooting game) 如何在游戏中自动按键? - how to press the key automatically in the game? Android-如何使AI进行自动验证? - Android - How to make AI which do auto validate? 使用 Nektos/act 在本地开发操作步骤时,如何在 github 操作中指定我的个人访问令牌? - How can i specify my Personal Access Token in a github action when using Nektos/act to develop action steps locally? 如何自动进行功能分支合并以进行开发? - How to automate feature branch merge on to develop?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM