goldfinch-eng / mono Goto Github PK
View Code? Open in Web Editor NEWThe main Goldfinch monorepo, including contracts, front-ends, etc.
License: MIT License
The main Goldfinch monorepo, including contracts, front-ends, etc.
License: MIT License
Uncovered by #18
Many functions called by baseDeploy
attempt to update config variables directly instead of using DeployEffects
to create a multisend to be executed by the protocol owner
Incorrect example
Here, the deploy script will immediately attempt to update the config variable with using the deployer account which doesn't have permission.
Correct example
Instead, updating the config variable should be added to DeployEffects
for the protocol owner to execute
When calling setupForTesting
, the following error pops up:
Error: call revert exception (method="creditLine()", errorArgs=null, errorName=null, errorSignature=null, reason=null, code=CALL_EXCEPTION, version=abi/5.4.1)
Line of code that triggers it: https://github.com/goldfinch-eng/mono/blob/main/packages/protocol/blockchain_scripts/setUpForTesting.ts#L234
From what I've read on the internet, it may be caused by the creditLine
not being present in the contract. Any hints to solve this?
Hello,
First of all, congrats for the amazing effort put into this repo.
I've tried to run the project, but it doesn't seem to be working. I'm getting the same errors over and over again.
When running npm run start:local
, I get:
Unhandled Rejection (Error): You must provide the json interface of the contract when instantiating a contract object.
▶ 3 stack frames were collapsed.
GoldfinchProtocol.getContract
src/ethereum/GoldfinchProtocol.ts:71
68 | } else {
69 | abi = contractOrAbi
70 | }
> 71 | const readOnly = new web3.readOnly.eth.Contract(abi, address) as unknown as T
| ^ 72 | ;(readOnly as any).loaded = true
73 | const userWallet = new web3.userWallet.eth.Contract(abi, address) as unknown as T
74 | ;(userWallet as any).loaded = true
When running start:local:liquidity-mining
, I get:
Unhandled Rejection (Error): MerkleDirectDistributor address of GFI contract doesn't match with deployed GFI address
MerkleDirectDistributor._callee$
src/ethereum/merkleDirectDistributor.ts:35
32 | }
33 | }
34 |
> 35 | async initialize(currentBlock: BlockInfo): Promise<void> {
| ^ 36 | const [gfiAddress, isPaused] = await Promise.all([
37 | this.contract.readOnly.methods.gfi().call(undefined, currentBlock.number),
38 | this.contract.readOnly.methods.paused().call(undefined, currentBlock.number),
Note that the second command was running fine before the last changes in May got pushed.
Can I please get some help here? Are there any additional steps that need to be taken in order to be able to run the project?
I run npm run start:local
and encounter this error
lerna ERR! npm run start stderr:
Error HH604: Error running JSON-RPC server: ERROR processing /mono/packages/protocol/deploy/setUpForTesting.ts:
Error: network does not support ENS
Here is my setUpForTesting:
import {HardhatRuntimeEnvironment} from "hardhat/types"
import {MAINNET_CHAIN_ID} from "../blockchain_scripts/deployHelpers"
import {setUpForTesting} from "../blockchain_scripts/setUpForTesting"
async function main(hre) {
await setUpForTesting(hre)
}
module.exports = main
module.exports.dependencies = ["base_deploy"]
module.exports.tags = ["setup_for_testing"]
module.exports.skip = async ({getChainId}: HardhatRuntimeEnvironment) => {
const chainId = await getChainId()
return String(chainId) === MAINNET_CHAIN_ID
}
Getting this error on both AVAX and Aurora networks, when trying to run the tests.
| TranchedPool · 24.504 · │
··············································|·············|················
| StakingRewards · 24.549 · │
TranchedPool
and StakingRewards
exceed the smart contract size limit, so they cannot be deployed on neither of these networks. Can we have the contracts reduced in size so they can be deployed on the network?
I run npm run start
and got this error
Error running JSON-RPC server: with hardhat-deploy >= 0.6 you need to rename network folder without appended chainId
You also need to create a '.chainId' file in the folder with the chainId
Is development in this repo still happening? Seems there haven't been any new merges for a couple month.
Or is there a different way to get the size of the junior tranche for a prospective deal?
When a user calls SeniorPool.invest
the SeniorPool should return the amount of USDC that was invested in the given tranched pool.
Given a TranchedPool T with 1 usdc in the tranched pool, when I call .invest
it should return 4
because the senior pool invests at a 4x leverage ratio.
Do you have any instructions/guidance for deploying all the smart contracts on a new network (other that localhost/ropsten/rinkeby/mainnet) such as polygon?
Any help is appreciated.
Currently the function getProtocolOwner
returns Goldfinch Governance's address non-conditionally. This prevents developers looking to deploy on a test net from being able to specify their own wallet as the protocol owner. Instead, this function should source the protocol owner from an environment variable or some other source that can be configured easily by a developer.
Getting a lot of such errors as you can see: https://rinkeby.etherscan.io/address/0x7a79e48e3c9be3faa2fadb2ea58c3374f2279c86
I've removed impersonateAccount
everywhere in the code, can this be a reason for the error?
Have you guys also experienced this? If so, how do you fix it?
One feature that would be awesome is the ability to sweep some funds to Compound, so that idle capital in the Senior Pool can be earning additional yield. And in fact, we already built this! However, for simplicity reasons, we built it such that it always sweeps all idle capital to Compound. And then if an LP withdraws, it would sweep it all back, and give the LP whatever the need. It required a manual action to sweep the funds back into Compound. We could have also swept the capital right back to Compound within the same withdraw transaction, but the gas costs would have been insane.
This was all fine in the very early days because we didn't have many LP's. But now that we have over 4800 LPs, withdraws happen multiple times/day, which basically breaks the feature.
So what would be awesome is the ability to sweep some funds to Compound (eg. 90% of available funds), so that 10% remains as liquidity for LPs. And only if someone wants to withdraw more than what remains at once would it trigger the withdraw back. This makes the accounting more difficult, but this feature would be very valuable! The core code to make it happen is already present here and here.
I have an Apple M1 Pro chipset and tried to compile the entire the project multiple times. The project does not seem to finish compiling, it seems that the installation just hangs after some point.
This didn't happen prior to the latest merge.
Command that's causing the issue: npm run bootstrap
.
PR that seems to have caused the issue: #27
deployFixedLeverageRatioStrategy
is not idempotent and will fail if called multiple times after deploy a contract.
The bug is caused by initialize
being called after the contract has already initialized. This is caused by this line being idempotent. During deploy, if hardhat doesn't detect bytecode changes from the contract attempting to be deployed and the currently deployed contract it won't deploy a new contract and instead will return the existing contract. If that contract has already been initialized then the second call to initialize
will fail.
To fix this initialize
should only be called if the contract hasn't already been intialized
in
https://github.com/goldfinch-eng/mono
I go:
npm install
npm run bootstrap
and this error comes out:
GOLDFINCH/mono/packages/server/node_modules/ts-node/src/index.ts:692
return new TSError(diagnosticText, diagnosticCodes);
^
TSError: ⨯ Unable to compile TypeScript:
../autotasks/index.ts(10,30): error TS2307: Cannot find module '@goldfinch-eng/protocol/typechain/ethers' or its corresponding type declarations.
is ethers the npm ethers package? if so, I tried installing it and it says I dont have permissions.
any ideas how to work around here?
After deploying the goldfinch contracts on Rinkeby, I'm trying to call setUpForTesting
to test the smart contract interaction.
However, I'm getting ProviderError: Unsupported method: hardhat_impersonateAccount
when trying to impersonate the account. Is there any workaround for this?
Is setUpForTesting
supposed to work only for mainnet forking
network?
It would be awesome to give Flight Academy participants NFT's. We were gonna use POAPs, but the POAP team seems to be backed up, and doesn't have time to talk to Goldfinch.
Could the community can spin up an NFT contract on Polygon or some other L2? Then we just need a way for people to claim. You could use a Merkle Distributor to let people claim, and could maybe create a simple front-end page (potentially using this repo).
There may be other ways to do it then what I'm describing! What are people's thoughts?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.