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: UNLICENCED | |
| pragma solidity ^0.8.7; | |
| contract ERC20Token { | |
| string public constant name = "Token"; | |
| string public constant symbol = "TKN"; | |
| uint8 public constant decimals = 18; | |
| event Approval(address indexed tokenOwner, address indexed spender, uint tokens); |
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: MIT | |
| pragma solidity ^0.6.6; | |
| import "./interfaces/IERC20.sol"; | |
| import "./Uniswap.sol"; | |
| contract Leveraged { | |
| IERC20 usdt = IERC20(0xd9145CCE52D386f254917e481eB44e9943F39138); |
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: GPL-3.0-or-later | |
| pragma solidity >=0.6.0; | |
| // helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false | |
| library TransferHelper { | |
| function safeApprove( | |
| address token, | |
| address to, | |
| uint256 value |
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 sys, time, pygame | |
| from random import randint | |
| from pygame.locals import * | |
| NUMBER_PLAYERS = 2000 # Lower if this runs slow on your computer | |
| goal_pos = [735, 735] # The pixel that you want the AI to get to. If you want "Survival Mode" (Trying to keep dots alive) set to [400, 400] | |
| def dist_to_goal(pos, goal_pos): | |
| return abs(pos[0]-goal_pos[0]) + abs(pos[1]-goal_pos[1]) |