Giter Club home page Giter Club logo

2022-10-3xcalibur's Introduction

3xcalibur contest details

Bounty Scope

The following changes makes up the scope of the 3xcalibur 10-2022 contest:

Contracts

Scope

Files in scope

File SLOC Coverage
Contracts (7)
contracts/periphery/Multiswap.sol ๐Ÿงช ๐Ÿ’ฐ 59 100.00%
contracts/Core/SwapFactory.sol ๐Ÿงฎ 76 68.00%
contracts/periphery/Minter.sol ๐Ÿ“ค 106 77.42%
contracts/periphery/Voter.sol 339 79.63%
contracts/periphery/Bribe.sol 354 62.62%
contracts/Core/SwapPair.sol ๐Ÿงฎ ๐Ÿ”– ๐ŸŒ€ 432 90.52%
contracts/periphery/Gauge.sol 452 68.70%
Total (over 7 files): 1818 75.84%

All other source contracts (not in scope)

File SLOC Coverage
Contracts (7)
contracts/periphery/BribeFactory.sol ๐ŸŒ€ 9 100.00%
contracts/periphery/GaugeFactory.sol ๐ŸŒ€ 9 100.00%
contracts/Core/SwapFees.sol 28 100.00%
contracts/periphery/Token.sol 53 86.36%
contracts/periphery/VotingDist.sol 264 29.49%
contracts/periphery/Router.sol ๐Ÿ’ฐ ๐Ÿ“ค ๐Ÿงฎ 357 73.19%
contracts/periphery/VotingEscrow.sol ๐Ÿ–ฅ ๐Ÿ“ค 647 90.53%
Libraries (3)
contracts/periphery/libraries/Math.sol 21 20.00%
contracts/Core/libraries/Math.sol 26 0.00%
contracts/periphery/libraries/Base64.sol ๐Ÿ–ฅ 39 100.00%
Interfaces (15)
contracts/Core/interfaces/callback/ISwapCallee.sol 4 -
contracts/periphery/interfaces/IBribeFactory.sol 4 -
contracts/periphery/interfaces/IGaugeFactory.sol 4 -
contracts/Core/interfaces/IERC20.sol 5 -
contracts/periphery/interfaces/IVotingDist.sol 5 -
contracts/periphery/interfaces/IWETH.sol ๐Ÿ’ฐ 6 -
contracts/periphery/interfaces/IMinter.sol 7 -
contracts/periphery/interfaces/IUnderlying.sol 8 -
contracts/periphery/interfaces/IBribe.sol 11 -
contracts/Core/interfaces/ISwapFactory.sol 13 -
contracts/Core/interfaces/ISwapPair.sol 24 -
contracts/periphery/interfaces/IGauge.sol 27 -
contracts/periphery/interfaces/IVotingEscrow.sol 36 -
contracts/periphery/interfaces/IVoter.sol 44 -
contracts/periphery/interfaces/IRouter.sol ๐Ÿ’ฐ 46 -
Total (over 25 files): 1697 70.71%

External imports

Description

3xcalibur is a decentralized exchange and liquidity protocol on Arbitrum nitro.
It is a fork of the Solidly protocol, which notably introduced $ x3y + y3x = k $ pools for concentrated stable-swaps, and improved on the Curve's emission mechanism.

We further improved on Solidly by allowing to use more complex emisson schedule strategies, added modifications to the governance mechanism, added convenience contracts to improve user experience, correcting bugs and redesigned tokenomics.

Tokens

The XCAL token is an ERC20 token with 18 decimals.
It is the main token of the protocol.
It can be locked in exchange for a VeNFT token that grants user voting power to direct the protocol's emissions, proportional to the locked amount and lock duration.

VeNFTs are ERC721 tokens.
They encode the amount and duration of the lock, and can be transferred to other users.
Can be used to direct emissions by voting for gauges (through the Voter contract).

LP tokens are ERC20 tokens.
They represent a share in a liquidity pool.

Deployment

Set environment variables in a .env file:

$ export PRIVATE_KEY=<ur private key>
$ export ALCHEMY_API_KEY=<your alchemy api key>

In root of repo:

$ yarn
$ npx hardhat run ./scripts/deploy.ts [--network <network>]

Deployed addresses will be in ./scipts/config/<network>.json

Tests

The test suite uses the foundry framework.

to install foundry, run:

curl -L https://foundry.paradigm.xyz | bash
foundryup

the all-in-one command to clone, build the repo, test and get gas reports is the following:

rm -Rf 2022-10-3xcalibur || true && git clone https://github.com/code-423n4/2022-10-3xcalibur.git && cd 2022-10-3xcalibur && mv contracts/Core contracts/core && npm install && foundryup && forge install foundry-rs/forge-std --no-commit && forge install transmissions11/solmate --no-commit && forge test --gas-report --fork-url https://arb1.arbitrum.io/rpc

note: if you have an issue where Cloudflare intercepts the rpc URL, an Infura Ethereum mainnet url works as well.

run tests:

# example
forge test -f https://arb1.arbitrum.io/rpc --force --gas-report

To get code coverage:

forge coverage

Slither

NOTE: Slither does not currently work on the repo. If you find a workaround, please share in the discord.

Details

- Your company/team/project's name? Do share a link if you have one:   3xcalibur (3xcalibur.com)
- Do you have a link to the repo that the contest will cover?:   It is currently private.
- If you have a public code repo, please share it here:   N/A
- How many core contracts are in scope?:   7
- Total SLoC for these contracts?:   1748
- How many external imports are there?:   4
- How many separate interfaces and struct definitions are there for the contracts within scope?:   Interfaces: 29 and Structs: 6
- Does most of your code generally use composition or inheritance?:   Composition
- How many external calls?:   0
- What is the overall line coverage percentage provided by your tests?:   71%
- Is there a need to understand a separate part of the codebase / get context in order to audit this part of the protocol?:   false
- Does it use an oracle?:   false
- Does the token conform to the ERC20 standard?:   Yes
- Are there any novel or unique curve logic or mathematical models?:   Yes, the solidly stableswap invariant by Andre Cronje
- Does it use a timelock function?:   No
- Is it an NFT?:   No
- Does it have an AMM?:   Yes
- Is it a fork of a popular project?:   true
- If yes, please describe your customisations:   Bribe: added functions to update rewards for all tokens at once and fixed bad rewards accounting. Pair: added a protocol fee tier. Gauge: remove hard-coded calculation in derivedBalance(),  added functions to update rewards by batch, or for all tokens at once. Minter: added functions to update emissions state.
- Does it use rollups?:   false
- Is it multi-chain?:   false
- Does it use a side-chain?:   false

Contact Us

Xen Discord: ๐Ÿ—ก็ฆ…๐Ÿ—ก#0369
Fly Discord: flyjgh#0741
Scam Discord: scamilcar#0983
Leez Discord: 0xLeez#7456
Rev Discord: RevolverOcelot#1548
7e1e Discord: ๐Ÿ—ก 0x7e1e ๐Ÿ—ก | 3six9 Core#4065

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.