Package Exports
- @0xnetfox/gem-farm-ts
- @0xnetfox/gem-farm-ts/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@0xnetfox/gem-farm-ts) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Gem Farm ๐
by Gemworks
Gem Farm is a collection of on-chain Solana programs for NFT ("gem" ๐) staking.
It consists of:
- Gem Bank ๐ฆ - responsible for storing NFTs, lets you configure which mints are/not allowed into the vaults
- Gem Farm ๐งโ๐พ - responsible for issuing rewards, lets you configure fixed/variable rates, lock up periods, fees, rarities & more
Gem Bank is used under the hood by Gem Farm.
Official deployment ๐
Both programs are now officially deployed across all 3 networks (mainnet, devnet, testnet):
bank: bankHHdqMuaaST4qQk6mkzxGeKPHWmqdgor6Gs8r88m
farm: farmL4xeBFVXJqtfxCzU9b28QACM7E2W2ctT6epAjvEYou can interact with them using this front-end (or build your own).
Deploy your own version ๐
git clonethe repo- Make sure you have
solana-cliinstalled, keypair configured, and at least 10 sol on devnet beforehand - Update path to your keypair in
Anchor.tomlthat begins withwallet = - Run
anchor buildto build the programs - We need to update the program IDs:
- Run
solana-keygen pubkey ./target/deploy/gem_bank-keypair.json- insert the new Bank prog ID in the following locations:./Anchor.toml./programs/gem_bank/src/lib.rs./src/index.ts(replace GEM_BANK_PROG_ID)
- And
solana-keygen pubkey ./target/deploy/gem_farm-keypair.json- insert the new Farm prog ID in the following locations:./Anchor.toml./programs/gem_farm/src/lib.rs./src/index.ts(replace GEM_FARM_PROG_ID)
- Run
- Run
anchor buildto build one more time - Run
anchor deploy --provider.cluster devnetto deploy to devnet - Now copy the IDLs into the apps:
cp ./target/idl/gem_bank.json ./app/gem-bank/publiccp ./target/idl/gem_bank.json ./app/gem-farm/publiccp ./target/idl/gem_farm.json ./app/gem-farm/public
- alternatively you can run the script I prepared
./scripts/cp_idl.sh - (!) IMPORTANT - run
yarninside the root of the repo - finally start the apps!
- eg cd into
app/gem-bankand run yarn && yarn serve
- eg cd into
- don't forget to open Chrome's console with
CMD+SHIFT+Ito get feedback from the app when you click buttons. It currently doesn't have a notifications system
Note that deploying your own version will cost you ~20 SOL.
Debug cryptic errors โ ๏ธ
If you get a cryptic error back that looks something like this:
Transaction failed 0x1798The steps to take are as follows:
- translate the 0x number into decimal (eg using this) - eg 0x1798 becomes 6040
- if the number is 6XXX, this is a custom error from the app. Go to errors.rs found here and find the error numbered 40 (the remainder of the decimal)
- any other number besides 6XXX means an anchor error - go here to decipher it
Docs โ๏ธ
Extensive documentation is available here.
The answer you're looking for is probably there. Pls don't DM with random questions.
License ๐งพ
MIT