[英]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解决方案
Here is a blockchain node provider use-case code implementation github:>这是一个区块链节点提供者用例代码实现 github:>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.