This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // SPDX-License-Identifier: Apache-2.0 | |
| pragma solidity 0.6.10; | |
| pragma experimental ABIEncoderV2; | |
| struct GenericData { | |
| address srcToken; | |
| address destToken; | |
| uint256 fromAmount; | |
| uint256 toAmount; | |
| uint256 quotedAmount; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import hashlib | |
| import random | |
| def choose_weighted_winner(participants, points, block_hash): | |
| """ | |
| Selects a winner using a weighted random selection based on points and a block hash. | |
| Args: | |
| participants (list): List of participant names or IDs. | |
| points (list): List of points corresponding to each participant. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // SPDX-License-Identifier: Apache-2.0 | |
| pragma solidity 0.8.26; | |
| import "forge-std/Test.sol"; | |
| import "forge-std/console.sol"; | |
| import {IERC20} from "@openzeppelin-contracts-5/contracts/token/ERC20/IERC20.sol"; | |
| //POST: https://api.odos.xyz/sor/quote/v2 | |
| //{ |
OlderNewer