-
Notifications
You must be signed in to change notification settings - Fork 40
feat: atomic ntoken #326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
0x8f701
wants to merge
19
commits into
main
Choose a base branch
from
feat/atomic-ntoken
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat: atomic ntoken #326
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
d69b27e
feat: atomic ntoken
0x8f701 5f10fb5
fix: fetching correct price
0x8f701 a03eb19
fix: typo
0x8f701 9abf268
feat: seperate uni v3 calculation
0x8f701 17b9093
Update contracts/interfaces/IAtomicCollateralizableERC721.sol
0x8f701 85ec241
fix: balance limit check
0x8f701 1f47cff
fix: typo
0x8f701 f64292a
chore: rename
0x8f701 d908928
feat: better atomic limit & api
0x8f701 14284dc
fix: typo & add basic tests
0x8f701 4b62fc9
chore: rename balancesOf to make it more clear
0x8f701 c481420
fix: lint
0x8f701 bb0705d
chore: dont format in during push
0x8f701 fabf472
chore: add simple liquidation test
0x8f701 a8a0964
chore: simplify
0x8f701 d9249ea
feat: improve tokenPrice calc
0x8f701 8ddd805
feat: gas optimization
0x8f701 ae058f8
feat: remove redundant check
0x8f701 e9c2b17
fix: underlyingAsset slot
0x8f701 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,18 +1,5 @@ | ||
| #!/usr/bin/env sh | ||
| . "$(dirname -- "$0")/_/husky.sh" | ||
|
|
||
| contracts=$( (git diff --cached --name-only --diff-filter=ACMR | grep -Ei "\.sol$") || true) | ||
| scripts=$( (git diff --cached --name-only --diff-filter=ACMR | grep -Ei "\.ts$") || true) | ||
| if [ -z "${contracts}" ] && [ -z "${scripts}" ]; then | ||
| exit 0 | ||
| fi | ||
| make format | ||
| if [ ! -z "${contracts}" ]; then | ||
| yarn typechain | ||
| git add $(echo "$contracts" | paste -s -d " " -) | ||
| fi | ||
|
|
||
| yarn typechain | ||
| yarn lint | ||
| if [ ! -z "${scripts}" ]; then | ||
| git add $(echo "$scripts" | paste -s -d " " -) | ||
| fi |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| // SPDX-License-Identifier: AGPL-3.0 | ||
| pragma solidity 0.8.10; | ||
|
|
||
| /** | ||
| * @title IAtomicCollateralizableERC721 | ||
| * @author Parallel | ||
| * @notice Defines the basic interface for an AtomicCollateralizableERC721. | ||
| **/ | ||
| interface IAtomicCollateralizableERC721 { | ||
| /** | ||
| * @dev get the collateralized atomic token balance of a specific user | ||
| */ | ||
| function atomicCollateralizedBalanceOf(address user) | ||
| external | ||
| view | ||
| returns (uint256); | ||
|
|
||
| /** | ||
| * @dev get the atomic token balance of a specific user | ||
| */ | ||
| function atomicBalanceOf(address user) external view returns (uint256); | ||
|
|
||
| /** | ||
| * @dev get the token balance of a specific user | ||
| */ | ||
| function underlyingBalancesOf(address user) | ||
| external | ||
| view | ||
| returns ( | ||
| uint256, | ||
| uint256, | ||
| uint256, | ||
| uint256 | ||
| ); | ||
|
|
||
| /** | ||
| * @dev get the atomic token id of a specific user of specific index | ||
| */ | ||
| function atomicTokenOfOwnerByIndex(address user, uint256 index) | ||
| external | ||
| view | ||
| returns (uint256); | ||
|
|
||
| /** | ||
| * @dev check if specific token is atomic (has multiplier) | ||
| */ | ||
| function isAtomicToken(uint256 tokenId) external view returns (bool); | ||
|
|
||
| /** | ||
| * @dev check if specific token has atomic pricing (has atomic oracle wrapper) | ||
| */ | ||
| function isAtomicPricing() external view returns (bool); | ||
|
|
||
| /** | ||
| * @dev get the trait multiplier of specific token | ||
| */ | ||
| function getTraitMultiplier(uint256 tokenId) | ||
| external | ||
| view | ||
| returns (uint256); | ||
|
|
||
| /** | ||
| * @dev get the trait multiplier sum of all collateralized tokens | ||
| */ | ||
| function getTraitMultiplierSumOfAllCollateralized(address user) | ||
| external | ||
| view | ||
| returns (uint256); | ||
| } |
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
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
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
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
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.