
Security News
Another Round of TEA Protocol Spam Floods npm, But It’s Not a Worm
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.
Install with pip install dfktools
https://pypi.org/project/dfktools/
This is a simple toolbox to interact with the contracts of DefiKingdoms
This software is not endorsed by, directly affiliated with, maintained, authorized, or sponsored by the DefiKingdoms team. All product and company names are the registered trademarks of their original owners. The use of any trade name or trademark is for identification and reference purposes only and does not imply any association with the trademark holder of their product brand.
Like this project ? Consider supporting future developments by:
Need help ? Join the GameFi Developers Discord
strength, agility, intelligence, wisdom, luck, vitality, endurance, dexteritypassive1, passive2, active1, active2logging, not printThe hero contract is accessible with hero/hero.py
Transfer a hero from one address to another
Hero's data can be retrieved with the get_hero method. A more human-friendly format can be generated
by passing the result of get_hero to the human_readable_hero method.
The owner of a hero can be retrieved with the method get_owner
The profile contract is accessible with profile/profile_v2.py
In-game profile can be retrieved with the get_profile method
The summoning contract is accessible with summoning/summoning.py
Summoning crystal are created with summon_crystal method
Crystal id can be retrieved with get_user_crystal_ids method
Summoning crystal can be open with open_crystal method
Put a hero up for hire with put_hero_for_rent and cancel with cancel_rent
Use is_on_rent and get_rent_auction to monitor auction
The gene science contract is accessible with genes/gene_science_v2.py
Statistics and visual of summoned hero can be forecasted with the mix_genes method.
Note that mix_genes is pseudo random and the resulting traits will be different for each block.
However, a statistical analysis can be used to optimize the summoning of desirable traits
The hero sale auction contract is accessible with auctions/hero/sale_auctions.py The hero rent auction contract is accessible with auctions/hero/rent_auctions.py Generic sale auction (ex: land) contract are accessible with auctions/auction.py
auction_example.py land_example.py
bid_hero and get_auction interact directly with the contract.
get_recent_open_auctions and get_hero_open_auctions use Graphql.
get_recent_open_auctions and get_hero_open_auctions use Graphql.
All quest contracts are located in module quests
Each quest requires at least 7 stamina to complete. Check the current stamina of any given hero with get_current_stamina.
Start the quest with start_quest. The second parameter is the number of attempt. To optimize the cost of gas, it is recommended
to use a hero at full stamina and do 3 attempts every call.
Uses V2 quest
Gardening and mining quest can be started with just one stamina. Mining quest can be done with up to 6 heroes while only 1 hero at a time can be sent on a gardening quest to a specific garden (liquidity pool).
Uses V1 quest
In game tokens and AMM exchange are available in module dex
Use dex.erc20.balance_of to retrieve the balance of an item for the specified address
Use wrapper class dex.uniswap_v2_pair.UniswapV2Pair and call expected_amount0 to get the estimated amount of token0 received in exchange of token1.
Alternatively, call dex.uniswap_v2_router.quote
Use call dex.uniswap_v2_router.swap_exact_tokens_for_eth to swap erc20 token for ONE.
Use call dex.uniswap_v2_router.swap_exact_tokens_for_tokens to swap erc20 tokens for other erc20 tokens.
Use wrapper class dex.master_gardener.Garden to retrieve staking pool info
Meditation circle contract is accessible with meditation/meditation.py
Use start_meditation and complete_meditation to level up a hero. Make sure to have enough rune for the hero's level with get_required_runes
All duel contracts are located in module duel
All raffle contracts are located in module raffle
All pet related contracts are located in module pets
Use pet.py to manage pet NFT
Use hatchery.py to hatch pet egg
Use exchange.py to exchange 2 pets for an egg
All bridge contracts are located in module bridge
Be careful to not mix up RPCs when dealing with multichain transaction
FAQs
A toolbox for DefiKingdoms
We found that dfktools demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.

Security News
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads

Research
/Security News
A malicious Chrome extension posing as an Ethereum wallet steals seed phrases by encoding them into Sui transactions, enabling full wallet takeover.