repo_id stringclasses 400
values | commit_sha stringclasses 400
values | commit_index int32 0 951 | in_repo_split stringclasses 1
value | cross_repo_split stringclasses 1
value | test_file stringlengths 7 121 | test_function stringlengths 1 108 | assertion_type stringclasses 32
values | difficulty stringclasses 8
values | context_lines int32 3 600 | prefix large_stringlengths 44 113k | target large_stringlengths 1 498 | anchor_sha stringclasses 400
values | anchor_index int32 0 951 | qna_source stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/Minter/test_minter.py | test_mint_immediate | assert | variable | 43 | import brownie
import pytest
import itertools
TYPE_WEIGHTS = [5e17, 1e19]
GAUGE_WEIGHTS = [1e19, 1e18, 5e17]
GAUGE_TYPES = [0, 0, 1]
MONTH = 86400 * 30
WEEK = 7 * 86400
def minter_setup(accounts, mock_lp_token, token, minter, gauge_controller, three_gauges):
token.set_minter(minter, {'from': accounts[0]})
#... | balance | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/VestingEscrow/test_claim.py | test_claim_multiple | assert | variable | 18 | import pytest
ZERO_ADDRESS = "0x0000000000000000000000000000000000000000"
def initial_funding(vesting, accounts):
recipients = [accounts[1]] + [ZERO_ADDRESS] * 99
vesting.add_tokens(10**21, {'from': accounts[0]})
vesting.fund(recipients, [10**20] + [0] * 99, {'from': accounts[0]})
def test_claim_multiple... | balance | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/VestingEscrowFactory/test_claim_simple.py | test_claim_multiple | assert | variable | 11 | ZERO_ADDRESS = "0x0000000000000000000000000000000000000000"
def test_claim_multiple(vesting_simple, coin_a, accounts, chain, start_time, end_time):
chain.sleep(start_time - chain.time() - 1000)
balance = 0
for i in range(11):
chain.sleep((end_time - start_time) // 10)
vesting_simple.claim({... | balance | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/integration/ERC20CRV/test_mintable_in_timeframe.py | test_mintable_in_timeframe | assert | variable | 24 | import pytest
from brownie.test import strategy, given
from tests.conftest import approx
from tests.conftest import YEAR, YEAR_1_SUPPLY, INITIAL_SUPPLY
def initial_setup(chain, token):
chain.sleep(86401)
token.update_mining_parameters()
@given(time=strategy("decimal", min_value=1, max_value=7))
def test_mint... | mintable | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/integration/ERC20CRV/test_mintable_in_timeframe.py | test_available_supply | assert | variable | 21 | import pytest
from brownie.test import strategy, given
from tests.conftest import approx
from tests.conftest import YEAR, YEAR_1_SUPPLY, INITIAL_SUPPLY
def initial_setup(chain, token):
chain.sleep(86401)
token.update_mining_parameters()
@given(duration=strategy('uint', min_value=1, max_value=YEAR))
def test_... | expected | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/integration/GaugeController/test_types_and_weights.py | invariant_relative_gauge_weight | assert | variable | 91 | from brownie import chain
from brownie.test import strategy
WEEK = 7 * 86400
class StateMachine:
st_type = strategy("decimal", min_value=0, max_value="0.99999999")
st_gauge_weight = strategy("uint", min_value=10 ** 17, max_value=10 ** 19)
st_type_weight = strategy("uint", min_value=10 ** 17, max_value=10... | expected | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/ERC20CRV/test_epoch_time_supply.py | test_available_supply | assert | variable | 15 | import brownie
WEEK = 86400 * 7
YEAR = 365 * 86400
def test_available_supply(chain, web3, token):
creation_time = token.start_epoch_time()
initial_supply = token.totalSupply()
rate = token.rate()
chain.sleep(WEEK)
chain.mine()
expected = initial_supply + (chain[-1].timestamp - creation_time) ... | expected | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/ERC20CRV/test_mint.py | test_available_supply | assert | variable | 21 | import brownie
import pytest
WEEK = 86400 * 7
YEAR = 365 * 86400
ZERO_ADDRESS = "0x0000000000000000000000000000000000000000"
def initial_setup(chain, token):
chain.sleep(86401)
token.update_mining_parameters()
def test_available_supply(chain, token):
creation_time = token.start_epoch_time()
initial_s... | expected | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/GaugeController/test_total_weight.py | test_multiple | assert | variable | 17 | TYPE_WEIGHTS = [5 * 10 ** 17, 2 * 10 ** 18]
GAUGE_WEIGHTS = [2 * 10 ** 18, 10 ** 18, 5 * 10 ** 17]
def test_multiple(accounts, chain, gauge_controller, three_gauges):
gauge_controller.add_type(b'Insurance', TYPE_WEIGHTS[1], {'from': accounts[0]})
gauge_controller.add_gauge(three_gauges[0], 0, GAUGE_WEIGHTS[0],... | expected | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/LiquidityGaugeRewardWrapper/test_claim_tokens.py | test_claim_crv | assert | variable | 35 | import brownie
import pytest
import itertools
MONTH = 86400 * 30
WEEK = 86400 * 7
def setup(accounts, mock_lp_token, token, minter, gauge_controller, liquidity_gauge_reward, reward_gauge_wrapper, reward_contract, coin_reward):
token.set_minter(minter, {'from': accounts[0]})
gauge_controller.add_type(b'Liquid... | expected | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/LiquidityGaugeWrapper/test_claim_tokens.py | test_claim | assert | variable | 35 | import brownie
import pytest
import itertools
TYPE_WEIGHTS = [5e17, 1e19]
GAUGE_WEIGHTS = [1e19, 1e18, 5e17]
GAUGE_TYPES = [0, 0, 1]
MONTH = 86400 * 30
WEEK = 7 * 86400
def setup(accounts, mock_lp_token, token, minter, gauge_controller, liquidity_gauge, gauge_wrapper):
token.set_minter(minter, {'from': accounts[... | expected | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/Minter/test_minter.py | test_mint | assert | variable | 42 | import brownie
import pytest
import itertools
TYPE_WEIGHTS = [5e17, 1e19]
GAUGE_WEIGHTS = [1e19, 1e18, 5e17]
GAUGE_TYPES = [0, 0, 1]
MONTH = 86400 * 30
WEEK = 7 * 86400
def minter_setup(accounts, mock_lp_token, token, minter, gauge_controller, three_gauges):
token.set_minter(minter, {'from': accounts[0]})
#... | expected | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/VestingEscrowFactory/test_deploy_escrow.py | test_init_vars | assert | variable | 15 | import brownie
import pytest
ZERO_ADDRESS = "0x0000000000000000000000000000000000000000"
def initial_funding(coin_a, vesting_factory, accounts):
coin_a._mint_for_testing(10**21, {'from': accounts[0]})
coin_a.transfer(vesting_factory, 10**21, {'from': accounts[0]})
def test_init_vars(vesting_simple, accounts,... | end_time | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/LiquidityGaugeRewardWrapper/test_claim_tokens.py | test_claimable_tokens | assert | variable | 35 | import brownie
import pytest
import itertools
MONTH = 86400 * 30
WEEK = 86400 * 7
def setup(accounts, mock_lp_token, token, minter, gauge_controller, liquidity_gauge_reward, reward_gauge_wrapper, reward_contract, coin_reward):
token.set_minter(minter, {'from': accounts[0]})
gauge_controller.add_type(b'Liquid... | claimable | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/LiquidityGaugeWrapper/test_claim_tokens.py | test_claimable_tokens | assert | variable | 35 | import brownie
import pytest
import itertools
TYPE_WEIGHTS = [5e17, 1e19]
GAUGE_WEIGHTS = [1e19, 1e18, 5e17]
GAUGE_TYPES = [0, 0, 1]
MONTH = 86400 * 30
WEEK = 7 * 86400
def setup(accounts, mock_lp_token, token, minter, gauge_controller, liquidity_gauge, gauge_wrapper):
token.set_minter(minter, {'from': accounts[... | claimable | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/PoolProxy/test_parameter_admin.py | test_stop_ramp_A | assert | variable | 77 | import brownie
import pytest
ZERO_ADDRESS = "0x0000000000000000000000000000000000000000"
def param_pool(accounts):
pool_parameters_mock = """
amp: public(uint256)
fee: public(uint256)
admin_fee: public(uint256)
future_amp: public(uint256)
future_fee: public(uint256)
future_admin_fee: public(uint256)
@external
... | initial_A | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/integration/LiquidityGauge/test_liquidity_gauge.py | test_gauge_integral | assert | variable | 92 | from random import random, randrange
from tests.conftest import YEAR, approx
MAX_UINT256 = 2 ** 256 - 1
WEEK = 7 * 86400
def test_gauge_integral(accounts, chain, mock_lp_token, token, liquidity_gauge, gauge_controller):
alice, bob = accounts[:2]
# Wire up Gauge to the controller to have proper rates and stuf... | bob_staked | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/VestingEscrowFactory/test_deploy_escrow.py | test_start_and_duration | assert | variable | 22 | import brownie
import pytest
ZERO_ADDRESS = "0x0000000000000000000000000000000000000000"
def initial_funding(coin_a, vesting_factory, accounts):
coin_a._mint_for_testing(10**21, {'from': accounts[0]})
coin_a.transfer(vesting_factory, 10**21, {'from': accounts[0]})
def test_start_and_duration(VestingEscrowSim... | start_time | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/integration/ERC20CRV/test_mint_integration.py | test_mint_multiple | assert | variable | 33 | import brownie
import pytest
from brownie.test import strategy, given
from tests.conftest import YEAR
def initial_setup(chain, token):
chain.sleep(86401)
token.update_mining_parameters()
@given(durations=strategy('uint[5]', min_value=YEAR*0.33, max_value=YEAR*0.9))
def test_mint_multiple(accounts, chain, tok... | total_supply | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/integration/GaugeController/test_types_and_weights.py | invariant_total_type_weight | assert | variable | 75 | from brownie import chain
from brownie.test import strategy
WEEK = 7 * 86400
class StateMachine:
st_type = strategy("decimal", min_value=0, max_value="0.99999999")
st_gauge_weight = strategy("uint", min_value=10 ** 17, max_value=10 ** 19)
st_type_weight = strategy("uint", min_value=10 ** 17, max_value=10... | total_weight | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/integration/LiquidityGauge/test_liquidity_gauge.py | test_gauge_integral | assert | variable | 91 | from random import random, randrange
from tests.conftest import YEAR, approx
MAX_UINT256 = 2 ** 256 - 1
WEEK = 7 * 86400
def test_gauge_integral(accounts, chain, mock_lp_token, token, liquidity_gauge, gauge_controller):
alice, bob = accounts[:2]
# Wire up Gauge to the controller to have proper rates and stuf... | alice_staked | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/integration/VotingEscrow/test_deposit_withdraw_voting.py | invariant_escrow_current_balances | assert | variable | 150 | import brownie
from brownie import history, chain
from brownie.test import strategy
WEEK = 86400 * 7
MAX_TIME = 86400 * 365 * 4
GAS_LIMIT = 4_000_000
class StateMachine:
st_account = strategy('address', length=10)
st_value = strategy('uint64')
st_lock_duration = strategy('uint8')
st_sleep_duration... | total_supply | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/LiquidityGaugeRewardWrapper/test_transfer.py | test_total_supply_not_affected | assert | variable | 20 | import brownie
import pytest
def setup(accounts, gauge_controller, minter, liquidity_gauge_reward, reward_gauge_wrapper, token, mock_lp_token):
token.set_minter(minter, {'from': accounts[0]})
gauge_controller.add_type(b'Liquidity', 10**10, {'from': accounts[0]})
gauge_controller.add_gauge(liquidity_gauge_... | total_supply | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/LiquidityGaugeRewardWrapper/test_transferFrom.py | test_total_supply_not_affected | assert | variable | 21 | import brownie
import pytest
def setup(accounts, gauge_controller, minter, liquidity_gauge_reward, reward_gauge_wrapper, token, mock_lp_token):
token.set_minter(minter, {'from': accounts[0]})
gauge_controller.add_type(b'Liquidity', 10**10, {'from': accounts[0]})
gauge_controller.add_gauge(liquidity_gauge_... | total_supply | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/LiquidityGaugeWrapper/test_transfer.py | test_total_supply_not_affected | assert | variable | 20 | import brownie
import pytest
def setup(accounts, gauge_controller, minter, liquidity_gauge, gauge_wrapper, token, mock_lp_token):
token.set_minter(minter, {'from': accounts[0]})
gauge_controller.add_type(b'Liquidity', 10**10, {'from': accounts[0]})
gauge_controller.add_gauge(liquidity_gauge, 0, 0, {'from'... | total_supply | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/LiquidityGaugeWrapper/test_transferFrom.py | test_total_supply_not_affected | assert | variable | 21 | import brownie
import pytest
def setup(accounts, gauge_controller, minter, liquidity_gauge, gauge_wrapper, token, mock_lp_token):
token.set_minter(minter, {'from': accounts[0]})
gauge_controller.add_type(b'Liquidity', 10**10, {'from': accounts[0]})
gauge_controller.add_gauge(liquidity_gauge, 0, 0, {'from'... | total_supply | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/Minter/test_minter.py | test_mint_multiple_gauges | assert | variable | 50 | import brownie
import pytest
import itertools
TYPE_WEIGHTS = [5e17, 1e19]
GAUGE_WEIGHTS = [1e19, 1e18, 5e17]
GAUGE_TYPES = [0, 0, 1]
MONTH = 86400 * 30
WEEK = 7 * 86400
def minter_setup(accounts, mock_lp_token, token, minter, gauge_controller, three_gauges):
token.set_minter(minter, {'from': accounts[0]})
#... | total_minted | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/ERC20CRV/test_epoch_time_supply.py | test_start_epoch_time_write | assert | variable | 13 | import brownie
WEEK = 86400 * 7
YEAR = 365 * 86400
def test_start_epoch_time_write(token, chain, accounts):
creation_time = token.start_epoch_time()
chain.sleep(YEAR)
chain.mine()
# the constant function should not report a changed value
assert token.start_epoch_time() == | creation_time | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/LiquidityGaugeRewardWrapper/test_transfer.py | test_transfer_zero_tokens | assert | variable | 20 | import brownie
import pytest
def setup(accounts, gauge_controller, minter, liquidity_gauge_reward, reward_gauge_wrapper, token, mock_lp_token):
token.set_minter(minter, {'from': accounts[0]})
gauge_controller.add_type(b'Liquidity', 10**10, {'from': accounts[0]})
gauge_controller.add_gauge(liquidity_gauge_... | sender_balance | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/LiquidityGaugeRewardWrapper/test_transferFrom.py | test_caller_balance_not_affected | assert | variable | 21 | import brownie
import pytest
def setup(accounts, gauge_controller, minter, liquidity_gauge_reward, reward_gauge_wrapper, token, mock_lp_token):
token.set_minter(minter, {'from': accounts[0]})
gauge_controller.add_type(b'Liquidity', 10**10, {'from': accounts[0]})
gauge_controller.add_gauge(liquidity_gauge_... | caller_balance | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/LiquidityGaugeRewardWrapper/test_transferFrom.py | test_transfer_zero_tokens | assert | variable | 21 | import brownie
import pytest
def setup(accounts, gauge_controller, minter, liquidity_gauge_reward, reward_gauge_wrapper, token, mock_lp_token):
token.set_minter(minter, {'from': accounts[0]})
gauge_controller.add_type(b'Liquidity', 10**10, {'from': accounts[0]})
gauge_controller.add_gauge(liquidity_gauge_... | sender_balance | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/LiquidityGaugeWrapper/test_transfer.py | test_transfer_zero_tokens | assert | variable | 20 | import brownie
import pytest
def setup(accounts, gauge_controller, minter, liquidity_gauge, gauge_wrapper, token, mock_lp_token):
token.set_minter(minter, {'from': accounts[0]})
gauge_controller.add_type(b'Liquidity', 10**10, {'from': accounts[0]})
gauge_controller.add_gauge(liquidity_gauge, 0, 0, {'from'... | sender_balance | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/LiquidityGaugeWrapper/test_transferFrom.py | test_caller_balance_not_affected | assert | variable | 21 | import brownie
import pytest
def setup(accounts, gauge_controller, minter, liquidity_gauge, gauge_wrapper, token, mock_lp_token):
token.set_minter(minter, {'from': accounts[0]})
gauge_controller.add_type(b'Liquidity', 10**10, {'from': accounts[0]})
gauge_controller.add_gauge(liquidity_gauge, 0, 0, {'from'... | caller_balance | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/LiquidityGaugeWrapper/test_transferFrom.py | test_transfer_zero_tokens | assert | variable | 21 | import brownie
import pytest
def setup(accounts, gauge_controller, minter, liquidity_gauge, gauge_wrapper, token, mock_lp_token):
token.set_minter(minter, {'from': accounts[0]})
gauge_controller.add_type(b'Liquidity', 10**10, {'from': accounts[0]})
gauge_controller.add_gauge(liquidity_gauge, 0, 0, {'from'... | sender_balance | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/integration/LiquidityGaugeReward/test_borked_rewards.py | test_withdraw_borked_rewards | assert | complex_expr | 32 | import pytest
from brownie.test import given, strategy
from hypothesis import settings
def initial_setup(accounts, reward_contract, mock_lp_token, liquidity_gauge_reward):
mock_lp_token.approve(liquidity_gauge_reward, 2 ** 256-1, {'from': accounts[0]})
liquidity_gauge_reward.deposit(100000, {'from': accounts[0... | 10**18 | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/GaugeController/test_gauges_weights.py | test_gauge_weight | assert | complex_expr | 13 | import brownie
WEEK = 7 * 86400
YEAR = 365 * 86400
TYPE_WEIGHTS = [5 * 10 ** 17, 2 * 10 ** 18]
GAUGE_WEIGHTS = [2 * 10 ** 18, 10 ** 18, 5 * 10 ** 17]
def test_gauge_weight(accounts, gauge_controller, gauge):
gauge_controller.add_gauge(gauge, 0, 10**19, {'from': accounts[0]})
assert gauge_controller.get_gau... | 10**19 | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/GaugeController/test_gauges_weights.py | test_set_gauge_weight | assert | complex_expr | 15 | import brownie
WEEK = 7 * 86400
YEAR = 365 * 86400
TYPE_WEIGHTS = [5 * 10 ** 17, 2 * 10 ** 18]
GAUGE_WEIGHTS = [2 * 10 ** 18, 10 ** 18, 5 * 10 ** 17]
def test_set_gauge_weight(chain, accounts, gauge_controller, gauge):
gauge_controller.add_gauge(gauge, 0, {'from': accounts[0]})
gauge_controller.change_gauge_... | 10**21 | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/GaugeController/test_vote_weight_unitary.py | test_effect_on_following_period | assert | complex_expr | 19 | import pytest
YEAR = 86400 * 365
def gauge_vote_setup(accounts, chain, gauge_controller, three_gauges, voting_escrow, token):
gauge_controller.add_type(b'Insurance', {'from': accounts[0]})
gauge_controller.add_gauge(three_gauges[0], 0, {'from': accounts[0]})
gauge_controller.add_gauge(three_gauges[1], 1, ... | 10**18 | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/LiquidityGaugeRewardWrapper/test_approve.py | test_approve | assert | complex_expr | 8 | import brownie
import pytest
def test_approve(reward_gauge_wrapper, accounts):
reward_gauge_wrapper.approve(accounts[1], 10**19, {'from': accounts[0]})
assert reward_gauge_wrapper.allowance(accounts[0], accounts[1]) == | 10**19 | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/LiquidityGaugeWrapper/test_approve.py | test_approve | assert | complex_expr | 8 | import brownie
import pytest
def test_approve(gauge_wrapper, accounts):
gauge_wrapper.approve(accounts[1], 10**19, {'from': accounts[0]})
assert gauge_wrapper.allowance(accounts[0], accounts[1]) == | 10**19 | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/VestingEscrow/test_claim.py | test_claim_full | assert | complex_expr | 15 | import pytest
ZERO_ADDRESS = "0x0000000000000000000000000000000000000000"
def initial_funding(vesting, accounts):
recipients = [accounts[1]] + [ZERO_ADDRESS] * 99
vesting.add_tokens(10**21, {'from': accounts[0]})
vesting.fund(recipients, [10**20] + [0] * 99, {'from': accounts[0]})
def test_claim_full(ves... | 10**20 | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/VestingEscrow/test_disable_and_claim.py | test_disable_after_end_time | assert | complex_expr | 16 | import pytest
ZERO_ADDRESS = "0x0000000000000000000000000000000000000000"
def initial_funding(vesting, accounts):
recipients = [accounts[1]] + [ZERO_ADDRESS] * 99
vesting.add_tokens(10**21, {'from': accounts[0]})
vesting.fund(recipients, [10**20] + [0] * 99, {'from': accounts[0]})
def test_disable_after_... | 10**20 | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/VestingEscrow/test_fund.py | test_balanceOf | assert | complex_expr | 12 | import brownie
import pytest
ZERO_ADDRESS = "0x0000000000000000000000000000000000000000"
AMOUNTS = [10**17 * i for i in range(1, 101)]
def initial_setup(accounts, vesting):
vesting.add_tokens(10**21, {'from': accounts[0]})
def test_balanceOf(coin_a, vesting):
assert coin_a.balanceOf(vesting) == | 10**21 | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/VestingEscrow/test_fund.py | test_one_recipient | assert | complex_expr | 15 | import brownie
import pytest
ZERO_ADDRESS = "0x0000000000000000000000000000000000000000"
AMOUNTS = [10**17 * i for i in range(1, 101)]
def initial_setup(accounts, vesting):
vesting.add_tokens(10**21, {'from': accounts[0]})
def test_one_recipient(vesting, accounts):
recipients = [accounts[5]] + [ZERO_ADDRESS]... | 10**20 | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/VestingEscrowFactory/test_claim_simple.py | test_claim_full | assert | complex_expr | 8 | ZERO_ADDRESS = "0x0000000000000000000000000000000000000000"
def test_claim_full(vesting_simple, coin_a, accounts, chain, end_time):
chain.sleep(end_time - chain.time())
vesting_simple.claim({'from': accounts[1]})
assert coin_a.balanceOf(accounts[1]) == | 10**20 | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/VestingEscrowFactory/test_deploy_escrow.py | test_token_xfer | assert | complex_expr | 13 | import brownie
import pytest
ZERO_ADDRESS = "0x0000000000000000000000000000000000000000"
def initial_funding(coin_a, vesting_factory, accounts):
coin_a._mint_for_testing(10**21, {'from': accounts[0]})
coin_a.transfer(vesting_factory, 10**21, {'from': accounts[0]})
def test_token_xfer(vesting_simple, coin_a):... | 10**20 | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/VestingEscrowFactory/test_disable_and_claim_simple.py | test_disable_after_end_time | assert | complex_expr | 9 | ZERO_ADDRESS = "0x0000000000000000000000000000000000000000"
def test_disable_after_end_time(vesting_simple, coin_a, accounts, chain, end_time):
chain.sleep(end_time - chain.time())
vesting_simple.toggle_disable(accounts[1], {'from': accounts[0]})
vesting_simple.claim({'from': accounts[1]})
assert coi... | 10**20 | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/VestingEscrowFactory/test_getters_simple.py | test_vested_supply | assert | complex_expr | 6 | def test_vested_supply(chain, vesting_simple, end_time):
assert vesting_simple.vestedSupply() == 0
chain.sleep(end_time - chain.time())
chain.mine()
assert vesting_simple.vestedSupply() == | 10**20 | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/GaugeController/test_vote_weight_unitary.py | test_remove_vote_means_no_weight | assert | complex_expr | 19 | import pytest
YEAR = 86400 * 365
def gauge_vote_setup(accounts, chain, gauge_controller, three_gauges, voting_escrow, token):
gauge_controller.add_type(b'Insurance', {'from': accounts[0]})
gauge_controller.add_gauge(three_gauges[0], 0, {'from': accounts[0]})
gauge_controller.add_gauge(three_gauges[1], 1, ... | 10 ** 18 | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/LiquidityGauge/test_kick.py | test_kick | assert | complex_expr | 17 | import brownie
MAX_UINT256 = 2 ** 256 - 1
WEEK = 7 * 86400
def test_kick(chain, accounts, liquidity_gauge, voting_escrow, token, mock_lp_token):
alice, bob = accounts[:2]
chain.sleep(2 * WEEK + 5)
token.approve(voting_escrow, MAX_UINT256, {'from': alice})
voting_escrow.create_lock(10 ** 20, chain.tim... | 10 ** 21 | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/LiquidityGaugeRewardWrapper/test_transferFrom.py | test_infinite_approval | assert | complex_expr | 18 | import brownie
import pytest
def setup(accounts, gauge_controller, minter, liquidity_gauge_reward, reward_gauge_wrapper, token, mock_lp_token):
token.set_minter(minter, {'from': accounts[0]})
gauge_controller.add_type(b'Liquidity', 10**10, {'from': accounts[0]})
gauge_controller.add_gauge(liquidity_gauge_... | 2**256-1 | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/LiquidityGaugeWrapper/test_transferFrom.py | test_infinite_approval | assert | complex_expr | 18 | import brownie
import pytest
def setup(accounts, gauge_controller, minter, liquidity_gauge, gauge_wrapper, token, mock_lp_token):
token.set_minter(minter, {'from': accounts[0]})
gauge_controller.add_type(b'Liquidity', 10**10, {'from': accounts[0]})
gauge_controller.add_gauge(liquidity_gauge, 0, 0, {'from'... | 2**256-1 | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/PoolProxy/test_owner_admin.py | test_set_burner | assert | complex_expr | 40 | import brownie
import pytest
ZERO_ADDRESS = "0x0000000000000000000000000000000000000000"
owner_functions_mock = """
# @version 0.2.7
aave: public(uint256)
donated: public(bool)
withdrawn: public(uint256)
@payable
@external
def __default__():
pass
@external
def set_aave_referral(referral_code: uint256):
sel... | 2**256-1 | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/integration/ERC20CRV/test_mintable_in_timeframe.py | test_random_range_multiple_epochs | assert | complex_expr | 29 | import pytest
from brownie.test import strategy, given
from tests.conftest import approx
from tests.conftest import YEAR, YEAR_1_SUPPLY, INITIAL_SUPPLY
def initial_setup(chain, token):
chain.sleep(86401)
token.update_mining_parameters()
@given(start=strategy('uint', max_value=YEAR*6), duration=strategy('uint... | rate * end | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/VestingEscrow/test_fund.py | test_multiple_calls_different_recipients | assert | complex_expr | 19 | import brownie
import pytest
ZERO_ADDRESS = "0x0000000000000000000000000000000000000000"
AMOUNTS = [10**17 * i for i in range(1, 101)]
def initial_setup(accounts, vesting):
vesting.add_tokens(10**21, {'from': accounts[0]})
def test_multiple_calls_different_recipients(vesting, accounts):
recipients = [account... | 10**20 * 4 | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/VestingEscrow/test_fund.py | test_multiple_calls_different_recipients | assert | complex_expr | 23 | import brownie
import pytest
ZERO_ADDRESS = "0x0000000000000000000000000000000000000000"
AMOUNTS = [10**17 * i for i in range(1, 101)]
def initial_setup(accounts, vesting):
vesting.add_tokens(10**21, {'from': accounts[0]})
def test_multiple_calls_different_recipients(vesting, accounts):
recipients = [account... | 10**20 * 2 | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/VestingEscrow/test_fund.py | test_multiple_calls_same_recipient | assert | complex_expr | 19 | import brownie
import pytest
ZERO_ADDRESS = "0x0000000000000000000000000000000000000000"
AMOUNTS = [10**17 * i for i in range(1, 101)]
def initial_setup(accounts, vesting):
vesting.add_tokens(10**21, {'from': accounts[0]})
def test_multiple_calls_same_recipient(vesting, accounts):
recipients = [accounts[5]] ... | 10**20 * 3 | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/VestingEscrow/test_getters.py | test_vested_of | assert | complex_expr | 14 | import pytest
amounts = [10**17 * i for i in range(1, 101)]
def initial_funding(vesting, accounts):
vesting.add_tokens(10**21, {'from': accounts[0]})
vesting.fund(accounts[:100], amounts, {'from': accounts[0]})
def test_vested_of(chain, vesting, accounts, end_time):
assert vesting.vestedOf(accounts[0]) =... | amounts[0] | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/ERC20CRV/test_setters.py | test_set_minter | assert | complex_expr | 7 | import brownie
def test_set_minter(accounts, token):
token.set_minter(accounts[1], {'from': accounts[0]})
assert token.minter() == | accounts[1] | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/GaugeController/test_gaugecontroller_admin.py | test_commit_transfer_ownership | assert | complex_expr | 7 | import brownie
def test_commit_transfer_ownership(gauge_controller, accounts):
gauge_controller.commit_transfer_ownership(accounts[1], {'from': accounts[0]})
assert gauge_controller.admin() == | accounts[0] | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/GaugeController/test_gaugecontroller_admin.py | test_commit_transfer_ownership | assert | complex_expr | 8 | import brownie
def test_commit_transfer_ownership(gauge_controller, accounts):
gauge_controller.commit_transfer_ownership(accounts[1], {'from': accounts[0]})
assert gauge_controller.admin() == accounts[0]
assert gauge_controller.future_admin() == | accounts[1] | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/PoolProxy/test_owner_admin.py | test_transfer_ownership | assert | complex_expr | 41 | import brownie
import pytest
ZERO_ADDRESS = "0x0000000000000000000000000000000000000000"
owner_functions_mock = """
# @version 0.2.7
aave: public(uint256)
donated: public(bool)
withdrawn: public(uint256)
@payable
@external
def __default__():
pass
@external
def set_aave_referral(referral_code: uint256):
sel... | accounts[4] | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/PoolProxy/test_set_admins.py | test_set_admins | assert | complex_expr | 11 | import brownie
import pytest
ZERO_ADDRESS = "0x0000000000000000000000000000000000000000"
def test_set_admins(accounts, pool_proxy):
pool_proxy.commit_set_admins(accounts[1], accounts[2], accounts[3], {'from': accounts[0]})
pool_proxy.apply_set_admins()
assert pool_proxy.ownership_admin() == | accounts[1] | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/PoolProxy/test_set_admins.py | test_set_admins | assert | complex_expr | 12 | import brownie
import pytest
ZERO_ADDRESS = "0x0000000000000000000000000000000000000000"
def test_set_admins(accounts, pool_proxy):
pool_proxy.commit_set_admins(accounts[1], accounts[2], accounts[3], {'from': accounts[0]})
pool_proxy.apply_set_admins()
assert pool_proxy.ownership_admin() == accounts[1]
... | accounts[2] | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/PoolProxy/test_set_admins.py | test_set_admins | assert | complex_expr | 13 | import brownie
import pytest
ZERO_ADDRESS = "0x0000000000000000000000000000000000000000"
def test_set_admins(accounts, pool_proxy):
pool_proxy.commit_set_admins(accounts[1], accounts[2], accounts[3], {'from': accounts[0]})
pool_proxy.apply_set_admins()
assert pool_proxy.ownership_admin() == accounts[1]
... | accounts[3] | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/VestingEscrow/test_vesting_escrow_admin.py | test_commit_transfer_ownership | assert | complex_expr | 7 | import brownie
def test_commit_transfer_ownership(vesting, accounts):
vesting.commit_transfer_ownership(accounts[1], {'from': accounts[0]})
assert vesting.admin() == | accounts[0] | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/VestingEscrow/test_vesting_escrow_admin.py | test_commit_transfer_ownership | assert | complex_expr | 8 | import brownie
def test_commit_transfer_ownership(vesting, accounts):
vesting.commit_transfer_ownership(accounts[1], {'from': accounts[0]})
assert vesting.admin() == accounts[0]
assert vesting.future_admin() == | accounts[1] | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/VestingEscrowFactory/test_admin_factory.py | test_commit_transfer_ownership | assert | complex_expr | 7 | import brownie
def test_commit_transfer_ownership(vesting_factory, accounts):
vesting_factory.commit_transfer_ownership(accounts[1], {'from': accounts[0]})
assert vesting_factory.admin() == | accounts[0] | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/VestingEscrowFactory/test_admin_factory.py | test_commit_transfer_ownership | assert | complex_expr | 8 | import brownie
def test_commit_transfer_ownership(vesting_factory, accounts):
vesting_factory.commit_transfer_ownership(accounts[1], {'from': accounts[0]})
assert vesting_factory.admin() == accounts[0]
assert vesting_factory.future_admin() == | accounts[1] | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/VestingEscrowFactory/test_admin_simple.py | test_commit_transfer_ownership | assert | complex_expr | 7 | import brownie
def test_commit_transfer_ownership(vesting_simple, accounts):
vesting_simple.commit_transfer_ownership(accounts[1], {'from': accounts[0]})
assert vesting_simple.admin() == | accounts[0] | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/VestingEscrowFactory/test_admin_simple.py | test_commit_transfer_ownership | assert | complex_expr | 8 | import brownie
def test_commit_transfer_ownership(vesting_simple, accounts):
vesting_simple.commit_transfer_ownership(accounts[1], {'from': accounts[0]})
assert vesting_simple.admin() == accounts[0]
assert vesting_simple.future_admin() == | accounts[1] | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/VotingEscrow/test_votingescrow_admin.py | test_commit_transfer_ownership | assert | complex_expr | 7 | import brownie
def test_commit_transfer_ownership(voting_escrow, accounts):
voting_escrow.commit_transfer_ownership(accounts[1], {'from': accounts[0]})
assert voting_escrow.admin() == | accounts[0] | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/VotingEscrow/test_votingescrow_admin.py | test_commit_transfer_ownership | assert | complex_expr | 8 | import brownie
def test_commit_transfer_ownership(voting_escrow, accounts):
voting_escrow.commit_transfer_ownership(accounts[1], {'from': accounts[0]})
assert voting_escrow.admin() == accounts[0]
assert voting_escrow.future_admin() == | accounts[1] | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/LiquidityGauge/test_kick.py | test_kick | assert | complex_expr | 27 | import brownie
MAX_UINT256 = 2 ** 256 - 1
WEEK = 7 * 86400
def test_kick(chain, accounts, liquidity_gauge, voting_escrow, token, mock_lp_token):
alice, bob = accounts[:2]
chain.sleep(2 * WEEK + 5)
token.approve(voting_escrow, MAX_UINT256, {'from': alice})
voting_escrow.create_lock(10 ** 20, chain.tim... | 4 * 10 ** 20 | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/PoolProxy/test_parameter_admin.py | test_stop_ramp_A | assert | complex_expr | 78 | import brownie
import pytest
ZERO_ADDRESS = "0x0000000000000000000000000000000000000000"
def param_pool(accounts):
pool_parameters_mock = """
amp: public(uint256)
fee: public(uint256)
admin_fee: public(uint256)
future_amp: public(uint256)
future_fee: public(uint256)
future_admin_fee: public(uint256)
@external
... | tx.timestamp | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/VestingEscrow/test_disable.py | test_disable | assert | complex_expr | 10 | import brownie
import pytest
ZERO_ADDRESS = "0x0000000000000000000000000000000000000000"
def test_disable(vesting, accounts):
tx = vesting.toggle_disable(accounts[1], {'from': accounts[0]})
assert vesting.disabled_at(accounts[1]) == | tx.timestamp | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/VestingEscrowFactory/test_disable_simple.py | test_disable | assert | complex_expr | 9 | import brownie
ZERO_ADDRESS = "0x0000000000000000000000000000000000000000"
def test_disable(vesting_simple, accounts):
tx = vesting_simple.toggle_disable(accounts[1], {'from': accounts[0]})
assert vesting_simple.disabled_at(accounts[1]) == | tx.timestamp | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/GaugeController/test_total_weight.py | test_change_type_weight | assert | complex_expr | 10 | TYPE_WEIGHTS = [5 * 10 ** 17, 2 * 10 ** 18]
GAUGE_WEIGHTS = [2 * 10 ** 18, 10 ** 18, 5 * 10 ** 17]
def test_change_type_weight(accounts, chain, gauge_controller, three_gauges):
gauge_controller.add_gauge(three_gauges[0], 0, 10**18, {'from': accounts[0]})
gauge_controller.change_type_weight(0, 31337, {'from': ... | 10**18 * 31337 | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/ERC20CRV/test_burn.py | test_burn | assert | complex_expr | 13 | import brownie
WEEK = 86400 * 7
YEAR = 365 * 86400
ZERO_ADDRESS = "0x0000000000000000000000000000000000000000"
def test_burn(accounts, token):
balance = token.balanceOf(accounts[0])
initial_supply = token.totalSupply()
token.burn(31337, {'from': accounts[0]})
assert token.balanceOf(accounts[0]) == | balance - 31337 | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/ERC20CRV/test_burn.py | test_burn_not_admin | assert | complex_expr | 13 | import brownie
WEEK = 86400 * 7
YEAR = 365 * 86400
ZERO_ADDRESS = "0x0000000000000000000000000000000000000000"
def test_burn_not_admin(accounts, token):
initial_supply = token.totalSupply()
token.transfer(accounts[1], 1000000, {'from': accounts[0]})
token.burn(31337, {'from': accounts[1]})
assert to... | 1000000 - 31337 | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/GaugeController/test_gauges_weights.py | test_add_gauges | assert | complex_expr | 14 | import brownie
WEEK = 7 * 86400
YEAR = 365 * 86400
TYPE_WEIGHTS = [5 * 10 ** 17, 2 * 10 ** 18]
GAUGE_WEIGHTS = [2 * 10 ** 18, 10 ** 18, 5 * 10 ** 17]
def test_add_gauges(accounts, gauge_controller, three_gauges):
gauge_controller.add_gauge(three_gauges[0], 0, {'from': accounts[0]})
gauge_controller.add_gauge... | three_gauges[0] | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/GaugeController/test_gauges_weights.py | test_add_gauges | assert | complex_expr | 15 | import brownie
WEEK = 7 * 86400
YEAR = 365 * 86400
TYPE_WEIGHTS = [5 * 10 ** 17, 2 * 10 ** 18]
GAUGE_WEIGHTS = [2 * 10 ** 18, 10 ** 18, 5 * 10 ** 17]
def test_add_gauges(accounts, gauge_controller, three_gauges):
gauge_controller.add_gauge(three_gauges[0], 0, {'from': accounts[0]})
gauge_controller.add_gauge... | three_gauges[1] | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/GaugeController/test_gauges_weights.py | test_type_weight | assert | complex_expr | 13 | import brownie
WEEK = 7 * 86400
YEAR = 365 * 86400
TYPE_WEIGHTS = [5 * 10 ** 17, 2 * 10 ** 18]
GAUGE_WEIGHTS = [2 * 10 ** 18, 10 ** 18, 5 * 10 ** 17]
def test_type_weight(accounts, gauge_controller):
gauge_controller.add_type(b'Insurance', {'from': accounts[0]})
assert gauge_controller.get_type_weight(0) =... | TYPE_WEIGHTS[0] | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/GaugeController/test_gauges_weights.py | test_change_type_weight | assert | complex_expr | 17 | import brownie
WEEK = 7 * 86400
YEAR = 365 * 86400
TYPE_WEIGHTS = [5 * 10 ** 17, 2 * 10 ** 18]
GAUGE_WEIGHTS = [2 * 10 ** 18, 10 ** 18, 5 * 10 ** 17]
def test_change_type_weight(accounts, gauge_controller):
gauge_controller.add_type(b'Insurance', {'from': accounts[0]})
gauge_controller.change_type_weight(1,... | TYPE_WEIGHTS[1] | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/VestingEscrow/test_fund.py | test_fund_admin | assert | complex_expr | 18 | import brownie
import pytest
ZERO_ADDRESS = "0x0000000000000000000000000000000000000000"
AMOUNTS = [10**17 * i for i in range(1, 101)]
def initial_setup(accounts, vesting):
vesting.add_tokens(10**21, {'from': accounts[0]})
@pytest.mark.parametrize("idx", range(1, 5))
def test_fund_admin(vesting, accounts, idx):
... | 10**21 - 10**20 | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/LiquidityGauge/test_deposit_for.py | test_deposit_for | assert | complex_expr | 11 | import brownie
def test_deposit_for(accounts, liquidity_gauge, mock_lp_token):
mock_lp_token.approve(liquidity_gauge, 2 ** 256 - 1, {"from": accounts[0]})
balance = mock_lp_token.balanceOf(accounts[0])
liquidity_gauge.set_approve_deposit(accounts[0], True, {'from': accounts[1]})
liquidity_gauge.deposit... | balance - 100000 | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/LiquidityGauge/test_deposit_withdraw.py | test_deposit | assert | complex_expr | 13 | import brownie
import pytest
def deposit_setup(accounts, liquidity_gauge, mock_lp_token):
mock_lp_token.approve(liquidity_gauge, 2 ** 256 - 1, {"from": accounts[0]})
def test_deposit(accounts, liquidity_gauge, mock_lp_token):
balance = mock_lp_token.balanceOf(accounts[0])
liquidity_gauge.deposit(100000, {... | balance - 100000 | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/LiquidityGaugeReward/test_deposit_for_rewards.py | test_deposit_for | assert | complex_expr | 11 | import brownie
def test_deposit_for(accounts, liquidity_gauge_reward, mock_lp_token, reward_contract):
mock_lp_token.approve(liquidity_gauge_reward, 2 ** 256 - 1, {"from": accounts[0]})
balance = mock_lp_token.balanceOf(accounts[0])
liquidity_gauge_reward.set_approve_deposit(accounts[0], True, {'from': acc... | balance - 100000 | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/LiquidityGaugeReward/test_deposit_withdraw_reward.py | test_deposit | assert | complex_expr | 13 | import brownie
import pytest
def deposit_setup(accounts, liquidity_gauge_reward, mock_lp_token):
mock_lp_token.approve(liquidity_gauge_reward, 2 ** 256 - 1, {"from": accounts[0]})
def test_deposit(accounts, liquidity_gauge_reward, mock_lp_token, reward_contract):
balance = mock_lp_token.balanceOf(accounts[0])... | balance - 100000 | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/integration/LiquidityGauge/test_deposits_withdrawals.py | teardown | assert | complex_expr | 84 | import brownie
from brownie import chain
from brownie.test import strategy
class StateMachine:
st_account = strategy("address", length=5)
st_value = strategy("uint64")
st_time = strategy("uint", max_value=86400 * 365)
def __init__(self, accounts, liquidity_gauge, mock_lp_token):
self.accounts... | initial + balance | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/LiquidityGaugeRewardWrapper/test_claim_tokens.py | test_multiple_depositors | assert | complex_expr | 45 | import brownie
import pytest
import itertools
MONTH = 86400 * 30
WEEK = 86400 * 7
def setup(accounts, mock_lp_token, token, minter, gauge_controller, liquidity_gauge_reward, reward_gauge_wrapper, reward_contract, coin_reward):
token.set_minter(minter, {'from': accounts[0]})
gauge_controller.add_type(b'Liquid... | expected - actual | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/LiquidityGaugeWrapper/test_claim_tokens.py | test_multiple_depositors | assert | complex_expr | 45 | import brownie
import pytest
import itertools
TYPE_WEIGHTS = [5e17, 1e19]
GAUGE_WEIGHTS = [1e19, 1e18, 5e17]
GAUGE_TYPES = [0, 0, 1]
MONTH = 86400 * 30
WEEK = 7 * 86400
def setup(accounts, mock_lp_token, token, minter, gauge_controller, liquidity_gauge, gauge_wrapper):
token.set_minter(minter, {'from': accounts[... | expected - actual | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/integration/LiquidityGauge/test_deposits_withdrawals.py | rule_deposit | assert | complex_expr | 41 | import brownie
from brownie import chain
from brownie.test import strategy
class StateMachine:
st_account = strategy("address", length=5)
st_value = strategy("uint64")
st_time = strategy("uint", max_value=86400 * 365)
def __init__(self, accounts, liquidity_gauge, mock_lp_token):
self.accounts... | balance - st_value | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/integration/LiquidityGauge/test_deposits_withdrawals.py | rule_withdraw | assert | complex_expr | 58 | import brownie
from brownie import chain
from brownie.test import strategy
class StateMachine:
st_account = strategy("address", length=5)
st_value = strategy("uint64")
st_time = strategy("uint", max_value=86400 * 365)
def __init__(self, accounts, liquidity_gauge, mock_lp_token):
self.accounts... | balance + st_value | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/integration/LiquidityGaugeReward/test_rewards_total.py | rule_deposit | assert | complex_expr | 54 | import brownie
from brownie import chain
from brownie.test import strategy
from tests.conftest import approx
class StateMachine:
st_account = strategy("address", length=5)
st_value = strategy("uint64", min_value=10 ** 10)
st_time = strategy("uint", max_value=365 * 86400)
st_reward = strategy("uint64")... | balance - st_value | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/integration/LiquidityGaugeReward/test_rewards_total.py | rule_withdraw | assert | complex_expr | 86 | import brownie
from brownie import chain
from brownie.test import strategy
from tests.conftest import approx
class StateMachine:
st_account = strategy("address", length=5)
st_value = strategy("uint64", min_value=10 ** 10)
st_time = strategy("uint", max_value=365 * 86400)
st_reward = strategy("uint64")... | balance + st_value | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/VestingEscrowFactory/test_deploy_escrow.py | test_deploys | assert | complex_expr | 17 | import brownie
import pytest
ZERO_ADDRESS = "0x0000000000000000000000000000000000000000"
def initial_funding(coin_a, vesting_factory, accounts):
coin_a._mint_for_testing(10**21, {'from': accounts[0]})
coin_a.transfer(vesting_factory, 10**21, {'from': accounts[0]})
def test_deploys(accounts, vesting_factory, ... | tx.new_contracts[0] | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/ERC20CRV/test_epoch_time_supply.py | test_start_epoch_time_write | assert | complex_expr | 16 | import brownie
WEEK = 86400 * 7
YEAR = 365 * 86400
def test_start_epoch_time_write(token, chain, accounts):
creation_time = token.start_epoch_time()
chain.sleep(YEAR)
chain.mine()
# the constant function should not report a changed value
assert token.start_epoch_time() == creation_time
# the... | creation_time + YEAR | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/ERC20CRV/test_inflation_delay.py | test_start_epoch_time | assert | complex_expr | 12 | WEEK = 86400 * 7
YEAR = 365 * 86400
def test_start_epoch_time(accounts, chain, token):
creation_time = token.start_epoch_time()
assert creation_time == token.tx.timestamp + 86400 - YEAR
chain.sleep(86401)
token.update_mining_parameters({'from': accounts[0]})
assert token.start_epoch_time() == | creation_time + YEAR | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
curvefi/curve-dao-contracts | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | train | train | tests/unitary/ERC20CRV/test_burn.py | test_burn | assert | complex_expr | 14 | import brownie
WEEK = 86400 * 7
YEAR = 365 * 86400
ZERO_ADDRESS = "0x0000000000000000000000000000000000000000"
def test_burn(accounts, token):
balance = token.balanceOf(accounts[0])
initial_supply = token.totalSupply()
token.burn(31337, {'from': accounts[0]})
assert token.balanceOf(accounts[0]) == ba... | initial_supply - 31337 | ec70363866b7127f1d33c87dcc6d12345db2d5c0 | 148 | v2_extractor_at_anchor |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.