Commit Graph

100 Commits

Author SHA1 Message Date
Alex Coseru
8bc4dab920
Feature/add_optimism & use graph-node 0.33.0 (#742)
* bump contracts

* remove ss contracts

* add optimism

* fix

* use upcoming barge

* move deactivateMint and delete sell test

* add withMint=True and delete sell test

* fix lint

* more fixes

* more fixes
2023-11-22 09:09:40 +02:00
Alex Coseru
c6004336ae
Predictoor support (#678)
* first cut, still WIP

* use specific contracts image

* fix missing abi

* more predictoor

* more predictoor

* done predictoor logic

* fix

* update

* merge #682

* update ready logic

* fixes

* lint

* increase timeout

* add oasis-saphire-testnet

* bump to contracts v2.0.0-next.2

* add loop for crappy rpc

* merge template

* fixes 1

* fixes

* fix predictor detection

* Use latest predictoor contracts (#708)

* Update tests.yml

* Update handlers

* Update schema

* Linter

* Update abi and fields

* use latest contracts

* use latest contracts

* expose agg preds in trueval

* fix abi path

* remove unused abis

* fix

---------

Co-authored-by: trizin <25263018+trizin@users.noreply.github.com>

* bump contracts

* Remove floatValue from predictoor trueval handler  (#714)

* Update predictSlot status on trueval submit (#716)

* Update status

* Fix

* Update contracts version

* Use number for predict slot

* Fixes

* Linter

* Fix

* Fix

* tostring

* Fix

* Fix

* Fix

* use contracts v2.0.0-next.11

* use latest graph-cli

* remove --debug flag

* Feature/add predictoor pause event (#723)

* bump contracts

* add pause for predictoorContract

* bump contracts to v2.0.0-13

* bum contracts & add sapphire mainnet

* fix lock

---------

Co-authored-by: trizin <25263018+trizin@users.noreply.github.com>
2023-11-21 15:55:49 +02:00
Alex Coseru
299d196162
Template id detection (#705)
* handle templateIds

* lint

* fixes

* fixes
2023-08-15 15:00:49 +03:00
trizin
2ca1280328
Add lockedAmount to veDelegation (#672)
* Add lockedAmount to veDelegation

* Fix typo

* Fixes

* Add lockedAmountinVe

* Replace lockedAmountinVe with timeLeft

* Use event.params.ts

* Fixes

* Fix

* Delete maxtime

* Fix

* Fix and rename

* Revert "Fix and rename"

This reverts commit 70846eafe2.

* fix

* fix

---------

Co-authored-by: alexcos20 <alex.coseru@gmail.com>
2023-05-13 15:38:57 +03:00
Maria Carmina
e1df119197
Fix #628 & #629 & #621: Store event log index for all records (#630)
* Store eventIndex.

* Changed in veDelegation. Removed import of String.

* linter.

* Removed tx hash.

* Revert some tweaks.

* added logIndex.

* converted to big int.

* 0 -> BigInt.zero().

* Added eventIndex to template and OPC.

* updated tweak

* updated tweak2

* Added eventIndex in tests.

* revert.

* Added eventIndex for TokenCreated and NFTCreated events. Increase time sleep for graphql request.

* Changed position of eventIndex in entity.

* Added eventIndex for order events and for dt events. Added new test commands in package.json.

* Added eventIndex for NFT Update events.

* Added eventIndex for dispenser.

* Modified dispenser tests.

* Reverted sleep secs. Updated tests.

* Updated dispenser tests. Added eventIndex for FRE.

* Added eventIndex in df rewards.

* Updated Ve with eventIndex.

* Updating order id with event index.

* Updated @ocean/lib with multichain version.

* Updated to number type.

* Updated tests for order.

* some changes.

* Fix dt tests. Added logs for provider fee. Need fix for Simple publish and consume tests.

* Problem raised by retrieving order event index in provider fee event handler.

* Added function for searching the right order.

* Debug order with provider fee.

* Removed console logs.

* Added debug logs.

* Hardcoded eventIndex just for testing.

* Paste logs from graph node.

* added extra sleep in test.

* fixed command.

* Added comments. Modified util function for Order Reuse.

* Added more logs and other tweaks.

* fixed command for docker logs.

* Added more logs.

* Converted to lowercase.

* Removed condition just for test.

* Added more logs. Order is not null.

* Call getOrder.

* Added verification back.

* converted to hex and add toString.

* Pass toString as param.

* Added ethereumjs util.

* replaced with ==.

* Refactored logic.

* Print event index.

* added more logs of event index.

* Modified tweaks and asserts.

* Added log for reuse order.

* updates.

* Reverted changes.

* Added check for eventIndex == 0.

* Enhanced the code. Replaced while with for.

* Added more logs for reuse test.

* added another condition.

* Added logs in tests. Removed redundant condition.

* Added more logs to test.

* Fixed typo.

* still debugging

* Refactored code.

* Getting closer.

* Fix tests for orders part. Removed logs.

* Removed more logs.

* Fix DT tests related to order.

* Implemented Publishing Market Fee event handler. Added test.

* Added consume market fee handler. Test consume market fee handler.

* Fixed tests for fees. Added TODOs.

* Generated ID with eventIndex in ficed rate. Added assert errors messages.

* Added FRE tests to workflow.

* Generated dispenser transaction with event index.

* Fixed dispenser tests.

* Add event index for NftUpdate entity ID.

* Changed IDs for VeDelegation and VeAllocationUpdate.

* Added full test suite to workflow.

* Fixed nft transfer ID.

* print blocks.

* test just dt and ending test to see the last block.

* Added df test.

* Added dispenser test.

* Added FRE test.

* Added NFT test.

* Added simple publish consume test.

* Added simple subgraph test.

* Added users test.

* Added ve test.

* Increased sleep time.

* commented delegation test.

* respect lint

* Fixed ending tests. Removed commented code. Brought back test suite.

* Print values from failing tests. Updated mappings.

* Rollback changes in veDelegation and veUtils. Added more prints for debug in tests.

* Removed veDelegation creation record.

* Rollback to the approach for veDelegation like it is in main.

* Removed prints. Match changes with main.

* Removed -1 from last block.

* Added prints for eventIndex. Fixed some suggestions.

* Fixed veDelegation.

* Removed prints.
2023-05-13 15:00:52 +03:00
Alex Coseru
5b2ccbc276
switch amount from wei to numeric (#666) 2023-04-28 17:37:02 +03:00
Alex Coseru
c33868d841
proper veDelegation (#663) 2023-04-28 09:36:56 +03:00
Alex Coseru
b376cb3942
add more veOcean stats (#655)
* add more veOcean stats
2023-04-14 11:30:27 +03:00
Jamie Hewitt
420a229a61
Removing amountFraction and adding timestamp (#647)
* Removing amountFraction

* Adding block timestamp

* initiating veDelegation timestamp

* add tx as well

---------

Co-authored-by: alexcos20 <alex.coseru@gmail.com>
2023-04-06 11:13:22 +03:00
Jamie Hewitt
0a3d513262
Storing the fraction of veOcean (#623)
* storing the fraction of veOcean

* Added moment.js

* Adding moment to package-lock.json

* Updating test

* Updating test

* Fixing failing transaction in test

* Increasing lock time

* Adding additional assert statements

* updating test

* Updating veDelegation test

* Updating query

* Updating test

* Updating test

* Making percentage update conditional

* Update handle extend boost

* Updating fraction amount

* Updating tests

* Adding comments

* Increasing sleep times

* Adding comment

* Revert "Increasing sleep times"

This reverts commit dc21fcdf8d.

* Removing comment

* Adding test

* Combining tests

* Updating test

* removing comments

* Remove comment

* Ensuring amountFraction is set to zero after burnBoost

* Changing bigInt to BigDecimal

* Updating test

* adding comment

* Setting zero value for new VeDelegation amountFraction

* Updating test query

* Updating tests

* Updating test

* Increase test sleep time

---------

Co-authored-by: idiom-bytes <69865342+idiom-bytes@users.noreply.github.com>
2023-03-30 08:29:31 -04:00
Alex Coseru
26a53431ea
fix veDeposit id generation (#606)
* fix veDeposit id generation

* handle both deposit & withdraw
2023-01-25 12:18:23 +02:00
Jamie Hewitt
9c56b00faa
Tracking OPC fees (#593)
* Tracking OPC fees

* Updating tests

* Updating tests

* Using basetoken decimals when tracking oceanFeeAmount

* Comparing the value of oceanFeeAmount returned from the event to the value stored in the subgraph

* Tracking consumeMarketFeeAmount and marketFeeAmount
2023-01-17 14:57:52 +03:00
Jamie Hewitt
20c27cd521
nft transfer event (#573)
* Updating schema

* updating nft.owner with newOwner

* Updating nftOwner in Order

* Fixing tests with nft.owner and nft.creator

* Tracking nft transferHistory

* removing nftOwner from order

* Removing nftOwner test from order

* Updating schema for nftTransferHistory

* Updating tests for transferHistory

* Updating test

* Fixing test

* Fixing timestamp test

* Revert "removing nftOwner from order"

This reverts commit 6f9aae3c40.

* Reverting removal of nftOwner Test + resolving conflicts
2022-11-24 15:40:31 +02:00
mihaisc
6c4fc1c346
add lastPriceToken (#567)
* add lastPriceToken

* test

* Updating tests to include lastPriceToken

Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com>
2022-11-21 16:31:13 +02:00
mihaisc
95fcfe9ba7
add chainId and nftAddress (#552)
* add chainId and nftAddress

* handle null
2022-09-30 16:10:16 +03:00
Alex Coseru
24df9f332e
fix allocation (#544)
* fix allocation
2022-09-26 08:38:37 +03:00
Alex Coseru
fe68442fe2
Feature/more ve (#543)
* link deposits to veOcean

* add FeeDistributor, claims & checkpoints

* fix lint

* link claims to VeOcean

* fix handleCheckpoint

* add comments & fix bug

* link veAllocationUser to veOcean (#537)

* advance chain

* fix veOcean withdraw

* bump contracts to 1.1.7

* fix test
2022-09-23 15:54:27 +03:00
Alex Coseru
8cb1d83a26
Feature/graphnode 27 (#541)
* use custom barge

* update for 27

* bump to latest contracts

* add description

* use main barge
2022-09-21 16:07:10 +03:00
Berkay Saglam
f61cce9722
Add gasUsed and gasPrice to order (#540)
* Add gasused to order



Co-authored-by: alexcos20 <alex.coseru@gmail.com>
2022-09-20 23:47:09 +03:00
Alex Coseru
73089dacc3
add erc725 key/value store (#533) 2022-09-13 20:07:10 +03:00
Alex Coseru
b1a58b7f13
Feature/df rewards (#531)
* bump contracts * oceanjs

* add DFRewards
2022-09-13 15:45:03 +03:00
Alex Coseru
c5d86d10df
nft updates (#530)
* nft updates

* use hasMetadata
2022-09-13 11:30:38 +03:00
Alex Coseru
0900c1fe88
update tests for new ocean.js 2.0 (#526)
* update tests for new ocean.js 2.0

* add tx&block to veDeposit

* add veOcean tests

* bump to oceanlib 2.0.0
2022-09-07 13:30:53 +03:00
Idiom
a10c6244b5
Implementing first pass of veAllocate schema, handlers, and test cove… (#490)
* Implementing first pass of veAllocate schema, handlers, and test coverage.

* Fixed compiling issues, wrote compiling & testing outline inside of veAllocate.test. More to come.

* Created documentation. Moving tests away from subgraph and into df-py.

* Expanding documentation to be thorough and cover more of the work involved.

* use barge artifacts

* use proper contracts in ci

* use barge artifacts folder

* fix replace

* use npm contracts dep

* use latest contracts for barge

* fix some lint

* Fix linter errors

* Update schema

* Finished basic integration of setAllocation event and verified queries/schema is working as intended.

* Fixing amount getter.

* Fixed remaining implementation, verified SimpleSubgraph.test is working, and fixed lint errors.

* Fixing import.

* Use .zero()

* Improve readability

* Add allocated to schema

* Update abi

* Update event handlers in the template

* Update veREADME

* Remove `AllocationRemoved` handler

* Hooking data for tx, firstContact, lastUpdate, block

* Update event abi

* Add chainId and nftAddress to schema

* Update `handleAllocationSet`

* Update abi

* Update readme

* Set initial values

* Fix math

* Missing event param

* set initial value of `lastContact`

* veOcean template

* VeOcean entity

* Handler functions - wip

* rename file

* Delegation schema

* veDelegate mapping file

* Rename

* Update template

* Update schema

* Update replaces

* Add handler for delegation

* Update schema

* getveDelegation

* Update naming

* Add deposit entity

* Update template

* Make delegation an array

* Add `handleDelegation`

* Add `handleDeposit` for veOCEAN

* Add `getveOCEAN` util function

* Add `getDeposit` util function

* Add `handleBurnBoost`

* Add `handleExtendBoost`

* Add `handleTransferBoost`

* Set default veOCEAN

* Remove unused import

* Rename Deposit to VeDeposit

* Include block number

* Remove `allocatedTotal`

* Updating schema and fixing errors due to naming changes. Let's keep the user current allocation, maybe we need to create a feature to more easily let them know whether they are fully allocated, or not..

* bump contracts to v1.1.1

* bump contracts

* bump to contracts 1.1.2

* fix script for networks without ve

* add veAllocation.sol's AllocationSetMultiple

* copy artfacts from barge for npm quickstart:barge

* fix using barge artifacts

* temp debug

* use barge artifacts

* use contracts 1.1.3

* use same approach for 'development'

* bump ocean-contracts

Co-authored-by: alexcos20 <alex.coseru@gmail.com>
Co-authored-by: mihaisc <mihai@oceanprotocol.com>
Co-authored-by: trizin <25263018+trizin@users.noreply.github.com>
2022-09-05 15:07:31 +03:00
Jamie Hewitt
1289a085bb
Remove tracking of pools (#492)
* Removing pool mapping

* Removing pool utils

* Removing pool transaction types

* Removing TokenTransaction from schema

* Removing pool functions from src/mappings/utils/globalUtils.ts

* Removing pool functions from src/mappings/factoryRouter.ts

* Removing pools from the schema

* removing pool events from subgraph.template.yaml

* Fixing TokenAdded in subgraph template

Co-authored-by: mihaisc <mihai@oceanprotocol.com>
2022-08-01 14:58:09 +03:00
mihaisc
6572762639
minor change (#501) 2022-07-26 08:42:17 -07:00
Alex Coseru
e7cb995797
add event Index to pool transactions (#497) 2022-07-26 12:04:17 +03:00
dependabot[bot]
5e581e8418
Bump @graphprotocol/graph-cli from 0.29.0 to 0.33.0 (#495)
* Bump @graphprotocol/graph-cli from 0.29.0 to 0.33.0

Bumps @graphprotocol/graph-cli from 0.29.0 to 0.33.0.

---
updated-dependencies:
- dependency-name: "@graphprotocol/graph-cli"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump @graphprotocol/graph-cli from 0.29.0 to 0.33.0

Bumps @graphprotocol/graph-cli from 0.29.0 to 0.33.0.

---
updated-dependencies:
- dependency-name: "@graphprotocol/graph-cli"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix other defaults

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: mihaisc <mihai@oceanprotocol.com>
2022-07-25 06:12:28 -07:00
Jamie Hewitt
493a6d2546 Revert "Removing pools from schema"
This reverts commit 0b8f6e1af5.
2022-07-20 12:34:56 +01:00
Jamie Hewitt
0b8f6e1af5 Removing pools from schema 2022-07-20 12:27:07 +01:00
Jamie Hewitt
3ebc29a74d
Issue 471 provider fees (#474)
* Adding providerFee to Order in the schema

* Adding ProviderFee to subgraph.template.yaml

* Creating order utils

* Saving providerFee as a string

* Saving providerFee as an array of all previous provider fees

* Creating test for providerFee

* Removing arrary from providerFee

* Updating or Creating OrderResue provider fee

* lint:fix

* Creating additional tests for testing providerFees on Order and reuseOrder

* lint:fix

* Updating JSON string notation

* Fixing first test

* fixing second test: testing provider fees after calling reuseOrder on a using a previous txId

* added providerFeeValidUntil

Co-authored-by: mihaisc <mihai@oceanprotocol.com>
2022-07-12 11:11:43 +03:00
Jamie Hewitt
011e256f5a
changing lastPriceToken from token to string (#477) 2022-06-30 12:54:05 +03:00
Jamie Hewitt
bc693e7797
changing the type of lastPriceToken from string to Token on Order (#462)
* changing the type of lastPriceToken from string to Token

* Fixing tests
2022-06-27 12:24:34 +03:00
mihaisc
28979c8c79
add version (#455) 2022-06-23 14:51:32 +03:00
mihaisc
a8dd151a01
fix (#456) 2022-06-13 19:11:25 +03:00
mihaisc
90f7e6482f
add reuse order (#444)
* add reuse order

* fix lint

* add yaml to gitignore

* delete yaml
2022-05-25 20:04:26 +03:00
Jamie Hewitt
4e5bcba661
Renaming consumeFee to orderFee (#434) 2022-05-17 12:27:48 +03:00
Jamie Hewitt
796bff70e7
removing Vesting and opcFee (#432)
* removing opcFee

* Removing OPCFeeChanged from subgraph.template.yaml

* Adding OPCFeeChanged event back into subgraph.template.yml

* Adding SSContractAdded and SSContractRemoved back in

* Formatting
2022-05-12 20:31:12 +03:00
mihaisc
a13ff28062
cleanup (#417)
Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro>
2022-04-29 14:37:07 +03:00
Alex Coseru
7073cd8743
bump contracts to alpha28 and ocean.js to alpha 33 (#401)
* bump contracts to alpha28 and ocean.js to alpha 33

* update dev deps

* fix pool reserves
2022-04-04 15:52:30 +03:00
mihaisc
17821115f9
fix pool exit values (#392)
* fix pool exit values

* fix lint
2022-03-29 05:59:32 -07:00
Alex Coseru
ccded4c4b1
Feature/lastprices (#369)
* consume volume step 1
2022-03-03 11:55:43 +02:00
mihaisc
1cfe520dad
fix lp fee and publish market fee (#368)
* add lp fee

* add publish market fee

* fix lint
2022-03-01 04:12:15 -08:00
Alex Coseru
5918c8b035
add vesting details (#353) 2022-02-23 17:47:34 +02:00
Alex Coseru
f5c7eeae00
Feature/templates (#349)
* templates
2022-02-21 12:45:24 +02:00
alexcos20
b6e2256826 small fixes 2022-02-20 05:51:01 -08:00
Alex Coseru
cbdbc64a42
add fixedrate balances (#339)
* add fixedrate balances
* fix dispensers
2022-02-20 10:00:16 +02:00
Alex Coseru
cb16470c9a
OPC fees (#337)
* OPC fees
2022-02-18 17:38:51 +02:00
Alex Coseru
772b723d8a
roles (#336)
* roles
2022-02-18 13:09:18 +02:00
Alex Coseru
dfb59ae6fd
add user totalSales and totalOrders (#333) 2022-02-17 17:22:02 +02:00