Skip to content

Commit

Permalink
Merge pull request #5 from curvefi/feat/deploy
Browse files Browse the repository at this point in the history
twocrypto-ng deployment
  • Loading branch information
bout3fiddy authored Dec 26, 2023
2 parents 841ed76 + d612fde commit ca10a54
Show file tree
Hide file tree
Showing 19 changed files with 1,183 additions and 492 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/integration-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: integration-tests-boa

on: [push]

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RPC_ETHEREUM: ${{ secrets.RPC_ETHEREUM }}

jobs:
boa-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Cache Compiler Installations
uses: actions/cache@v2
with:
path: |
~/.vvm
key: compiler-cache

- name: Setup Python 3.10.4
uses: actions/setup-python@v2
with:
python-version: 3.10.4

- name: Install Requirements
run: pip install -r requirements.txt

- name: Run Tests
run: python -m pytest tests/integration/test_create2_deployment.py
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ jobs:
run: pip install -r requirements.txt

- name: Run Tests
run: python -m pytest tests/ -n auto
run: python -m pytest tests/unitary -n auto
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ reports/
/data
todo.txt
node_modules
*.json
/audits

# temp
Expand Down
218 changes: 218 additions & 0 deletions abi/create2deployer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,218 @@
[
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "previousOwner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "OwnershipTransferred",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "Paused",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "Unpaused",
"type": "event"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "salt",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "codeHash",
"type": "bytes32"
}
],
"name": "computeAddress",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "salt",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "codeHash",
"type": "bytes32"
},
{
"internalType": "address",
"name": "deployer",
"type": "address"
}
],
"name": "computeAddressWithDeployer",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "value",
"type": "uint256"
},
{
"internalType": "bytes32",
"name": "salt",
"type": "bytes32"
},
{
"internalType": "bytes",
"name": "code",
"type": "bytes"
}
],
"name": "deploy",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "value",
"type": "uint256"
},
{
"internalType": "bytes32",
"name": "salt",
"type": "bytes32"
}
],
"name": "deployERC1820Implementer",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address payable",
"name": "payoutAddress",
"type": "address"
}
],
"name": "killCreate2Deployer",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "pause",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "paused",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "renounceOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "unpause",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"stateMutability": "payable",
"type": "receive"
}
]
1 change: 1 addition & 0 deletions contracts/main/CurveCryptoMathOptimized2.vy
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# pragma version 0.3.10
# pragma optimize gas
# pragma evm-version paris
# (c) Curve.Fi, 2020-2023
# AMM Math for 2-coin Curve Cryptoswap Pools
#
Expand Down
2 changes: 2 additions & 0 deletions contracts/main/CurveCryptoViews2Optimized.vy
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# pragma version 0.3.10
# pragma optimize gas
# pragma evm-version paris
"""
@title CurveCryptoViews2Optimized
@author Curve.Fi
Expand Down
16 changes: 13 additions & 3 deletions contracts/main/CurveTwocryptoFactory.vy
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# pragma version 0.3.10
# pragma optimize codesize
# pragma optimize gas
# pragma evm-version paris
"""
@title CurveTwocryptoFactory
@author Curve.Fi
Expand Down Expand Up @@ -72,6 +73,7 @@ A_MULTIPLIER: constant(uint256) = 10000
# Limits
MAX_FEE: constant(uint256) = 10 * 10 ** 9

deployer: address
admin: public(address)
future_admin: public(address)

Expand All @@ -92,7 +94,15 @@ pool_list: public(DynArray[address, 4294967296]) # master list of pools


@external
def __init__(_fee_receiver: address, _admin: address):
def __init__():
self.deployer = tx.origin


@external
def initialise_ownership(_fee_receiver: address, _admin: address):

assert msg.sender == self.deployer
assert self.admin == empty(address)

self.fee_receiver = _fee_receiver
self.admin = _admin
Expand Down Expand Up @@ -204,7 +214,7 @@ def deploy_pool(
packed_fee_params, # uint256
packed_rebalancing_params, # uint256
initial_price, # uint256
code_offset=3
code_offset=3,
)

# populate pool data
Expand Down
Loading

0 comments on commit ca10a54

Please sign in to comment.