Пост
Поделитесь своими знаниями.
How to get current timestamp in smart contracts on Amoy Testnet?
Hey tech community! So, I'm super new to all of this and currently running some tests on the Amoy testnet. I need to access current timestamp data in my smart contract. I've heard of Chainlink feeds or Time Oracles, but I'm not sure if they're available on Amoy or what alternatives I can use. Any tips or contract addresses I can try to integrate into my smart contract for fetching the current time? Appreciate any input or guidance on this!
- Smart Contract
Ответы
2Согласно имеющейся на данный момент информации, в тестовой сети Amoy нет официального развертывания Chainlink. block.timestamp
Если вам нужна текущая временная метка в вашем смарт-контракте, попробуйте использовать встроенную в Solidity метку времени. Это возвращает время добычи блока и может стать надежной альтернативой для получения текущей отметки времени. Если вы хотите изучить другие варианты Oracle на Amoy, рассмотрите возможность использования других децентрализованных сервисов oracle, если они совместимы с сетью Amoy. Посетите обсуждения или форумы, посвященные развитию сети Amoy, поскольку иногда инициативы сообщества могут предложить альтернативные варианты настройки Oracle.
Keep an eye on updates from Chainlink or the Amoy network communities to see if there will be official implementations in the future. For now, using block.timestamp
should suffice for testing and development on a testnet like Amoy.
Знаете ответ?
Пожалуйста, войдите в систему и поделитесь им.
Polygon is a decentralised Ethereum scaling platform that enables developers to build scalable user-friendly dApps with low transaction fees without ever sacrificing on security.