6

在智能合约获取概率 | 登链社区 | 技术问答

 2 years ago
source link: https://learnblockchain.cn/question/2054
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

20 在智能合约获取概率

最佳答案 2天前

在以太坊生成随机数的几种方式(含代码0)

https://learnblockchain.cn/article/1083

function importSeedFromThird() public view returns (uint8) {
        return uint8(
            uint256(keccak256(abi.encodePacked(block.timestamp, block.difficulty))) % 100
        );
}
越泽 - 智能合约
采纳率 27% | 回答于 2天前

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK