This file contains 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
# ported from https://github.com/shafu0x/MicroStable/blob/main/src/MicroStable.sol | |
from ethereum.ercs import IERC20 | |
import micro_stable | |
interface Oracle: | |
def latest_answer() -> uint256: view | |
MIN_COLLAT_RATIO: public(constant(uint256)) = 15 * 10**17 |
This file contains 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
from ethereum.ercs import IERC20 | |
from ethereum.ercs import IERC20Detailed | |
# INTERFACES # | |
interface IStrategy: | |
def asset() -> address: view | |
def balanceOf(owner: address) -> uint256: view | |
def maxDeposit(receiver: address) -> uint256: view | |
def maxWithdraw(owner: address) -> uint256: view |
This file contains 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
## pragma optimize codesize | |
# pragma enable-decimals | |
""" | |
@title CurveStableSwapNG | |
@author Curve.Fi | |
@license Copyright (c) Curve.Fi, 2020-2023 - all rights reserved | |
@notice Stableswap implementation for up to 8 coins with no rehypothecation, | |
i.e. the AMM does not deposit tokens into other contracts. The Pool contract also | |
records exponential moving averages for coins relative to coin 0. | |
@dev Asset Types: |
This file contains 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
## pragma optimize codesize | |
# pragma evm-version shanghai | |
# pragma enable-decimals | |
""" | |
@title CurveStableSwapNG | |
@author Curve.Fi | |
@license Copyright (c) Curve.Fi, 2020-2023 - all rights reserved | |
@notice Stableswap implementation for up to 8 coins with no rehypothecation, | |
i.e. the AMM does not deposit tokens into other contracts. The Pool contract also | |
records exponential moving averages for coins relative to coin 0. |
This file contains 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
2024-04-14T17:08:55.2635958Z Current runner version: '2.315.0' | |
2024-04-14T17:08:55.2663253Z ##[group]Operating System | |
2024-04-14T17:08:55.2663887Z Ubuntu | |
2024-04-14T17:08:55.2664206Z 22.04.4 | |
2024-04-14T17:08:55.2664653Z LTS | |
2024-04-14T17:08:55.2664970Z ##[endgroup] | |
2024-04-14T17:08:55.2665360Z ##[group]Runner Image | |
2024-04-14T17:08:55.2665866Z Image: ubuntu-22.04 | |
2024-04-14T17:08:55.2666266Z Version: 20240407.1.0 | |
2024-04-14T17:08:55.2667230Z Included Software: https://github.com/actions/runner-images/blob/ubuntu22/20240407.1/images/ubuntu/Ubuntu2204-Readme.md |
This file contains 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
#!/usr/bin/env python | |
with open("benchmark_control.easm", "w") as f: | |
print("PUSH1 251", file=f) | |
print("PUSH1 1", file=f) | |
for _ in range(10_000): # stay roughly within codesize limit, still large enough for benchmark | |
print("DUP2 MUL", file=f) | |
print("DUP1 DUP1 POP POP", file=f) |
This file contains 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
### | |
# access_control.vy | |
owner: address | |
def __init__(): | |
self.owner = msg.sender | |
def check_owner(): | |
assert msg.sender == self.owner | |
### |
This file contains 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
allowances: HashMap[address, HashMap[address, uint256]] | |
balanceOf: HashMap[address, uint256] | |
totalSupply: uint256 | |
bundle: ERC20Bundle | |
def __init__(): | |
... # do things with initializing and totalSupply | |
@external |
This file contains 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
# usage: | |
# install asan fork of vyper 0.3.10 (`pip install git+https://github.com/charles-cooper/vyper@asan`) | |
# change `import boa` to `import boa; import boa_asan` in scripts | |
from eth.exceptions import VMError | |
import boa.environment | |
class MemoryAccessViolation(VMError): | |
pass |
This file contains 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 requests | |
from openai_plugin import Plugin | |
class DefiLlama(Plugin): | |
def __init__(self): | |
self.base_url = "https://api.llama.fi" | |
def fetch_data(self, endpoint): | |
try: | |
response = requests.get(f"{self.base_url}/{endpoint}") |
NewerOlder