LE7EL Integrates with Polygon, Receives Polygon Village Grant

LE7EL
9 min readJun 21, 2023
LE7EL integrates with Polygon and receives a Polygon Village grant

At LE7EL, we are building a more open and fair future with decentralized and permissionless protocols that developers can use to enhance their games, whether they are built with LE7EL’s own game development SDK or not.

We’re excited to announce that we’ve selected Polygon (PoS) as the primary EVM chain for the deployment of all our tools, and received a Polygon Village grant that’ll help facilitate this deployment.

In this article, we’ll showcase our tools and protocols that use smart contracts on Polygon, and how you as a game developer can use them to enhance your game. Please note that you can deploy LE7EL’s smart contract tools to any EVM network, except for our unique NFTs, which are Polygon only for now.

Note: You can check out our full range of projects on Gitlab, where we have categorized them into “Play” and “Build” sections. The “Play” repos are our own implementations of the protocols we create in the “Build” section.

Avatar Domains

At LE7EL, we think of avatars as hubs for users’ game rewards and perks that they can level up and improve in different ways. A user can have multiple avatars that they can trade, transfer, or use however they want. It’s a key part of the user-owned self-custodial gaming experience that we envision at LE7EL.

On our roadmap, we plan to link XR avatars that can be used in the games or in the metaverse to these NFTs, so that new owners can customize their digital selves if they buy avatar NFTs on the open market. We are also exploring the possibility of using avatars as holders for other NFTs, such as game items, tokens, or XR avatar clothing. An example of how this can work is LE7EL’s staking system with $L7L rewards being stored by the avatar, so that the NFT owner can claim accumulated rewards at TGE.

Technically, Avatars are NFTs (nonfungible tokens) based on the ERC721 standard that we designed with ENS in mind. They are on-chain domains (like wenzel.avatar) with a limited namespace and on-chain metadata that owners can change. Owners pay a yearly fee to keep their domains, and anyone can grab expired domains without permission after a three-month grace period.

Third parties can also create their own custom avatar metadata, which is usually hidden in wallets or other NFT marketplaces, except for LE7EL’s own metadata: level, experience, etc. This feature lets you add your own leveling system to an existing avatar for your game. Another feature you can use with custom metadata is an on-chain whitelist or blacklist.

XR Domains

Why stop at user-owned avatars? XR domains (like game.xr) use the same technology as avatars and let you own entire games as NFTs, which you can tokenize or share ownership of if you use a DAO or a multisig. It’s never been easier to make a game in the metaverse that’s owned by its community. You can also monetize your creations by selling and earning royalties on popular NFT marketplaces like OpenSea.

XR domain metadata lets you keep important configuration options on-chain. Developers can create their own on-chain settings for their experiences, but the default ones are these:

  • Beneficiary address — gets all the on-chain income generated inside the game;
  • Token — a fungible token address that is used as payment token for transactions inside the game;
  • Manager addresses — list of addresses that have admin access to the game, can use the game editor, can publish new versions of it through SDK etc. Managers can also customize community pages on le7el.com (like https://le7el.com/app/communities/defikingdoms)

With a limited namespace of .xr domain, it’s also helpful to boost the game’s visibility in search and use human-friendly deeplinks (like le7el://game.xr) to launch such games.

Community Record Service (CRS)

Do you want to create your own NFT domain with a yearly lease system and all the features of LE7EL avatars or XR domains? No problem, you can use our general CRS solution either as a deployment to a separate network of your choice or you can join our canonical implementation on Polygon network with your custom zone domain zone, reusing LE7EL UX and customization features.

Rewards Engine

At LE7EL, we created a complete set of smart contracts, front-end libraries and tooling UX to reward any kind of user activity with tokens (ERC20, ERC777, ERC1155).

Start by creating a new project in Tooling UX

On-chain games can benefit from fully automated gas quest rewards with a fixed amount of tokens distributed pro-rata to all qualifying users based on gas spent on performing specific activity. Check out our DeFi Kingdoms quests to see how it works.

Configure gas quest reward distribution

Sometimes it’s easier to just distribute fixed rewards to specific wallets, based on some manual calculations or a snapshot. We got you covered here as well, by supporting reward distribution with the help of Google Spreadsheets. Just paste the published link to your spreadsheet with the list of wallets and their reward shares or amounts in two columns and publish it on-chain with the help of our tooling UX.

Manually defined distribution
Set Google Spreadsheet with manual distribution

Finally, your game can integrate our API to reward any activity, by sending qualifying events on-demand:

On-demand API to publish rewards
import {Le7elEvents} from "@le7el/rewards_engine"

const le7el_api = new Le7elEvents(PRIVATE_KEY) // PRIVATE_KEY is taken from your project in LE7EL UX.
le7el_api.sendEvent(
"0x6ecB6C62f723dC20fd9d44d95DeCC1f8AE655444",
"WonMatch",
{
score: 34,
totalParticipants: 5
}
)

CURL version for any backend language:

export DATA='{"nonce":1678294084655,"user_id":"0x6ecB6C62f723dC20fd9d44d95DeCC1f8AE655444","user_id_type":"wallet","context_type":"filter","platform":"web","event":"WonMatch","payload":{"score":34,"totalParticipants":5}}'
export SIGNATURE=$(echo -n "0x"; printf "\x19Ethereum Signed Message:\n%d%s" "$(echo -n "${DATA}" | wc -c)" "${DATA}" | keccak-256sum -l | xxd -r -p | openssl pkeyutl -sign -inkey private_key.pem | xxd -p)
curl -X POST -H "Content-Type: application/json" -H "Nonce: 1678294084655" -H "Authorization: Bearer ${SIGNATURE}" --data "${DATA}" "https://tools.le7el.com/v1/events"

The core of this library is MerkleDistributor, which is a way to publish reward tables on-chain with minimal gas usage for all parties. The differences from the original Uniswap implementation are admin controls and a round system. Admin can change reward tokens, claim interface, withdraw unclaimed rewards and pause distributions in case of emergencies. More importantly, it supports expiring rewards with the round system. When admin starts a new round, rewards from the previous round are automatically expired and no longer claimable. This allows perpetual usage of the same contract to distribute sequential reward batches, which is a common use case for games.

ConditionalDistributor module lets you automate rewards based on some on-chain metrics provided by the oracle contract. We offer ERC721Holder oracle for automatic allocation of rewards to NFT owners (ERC721) and OneTimeOffchainTickets for arbitrary reward amounts signed off-chain by an authorized validator wallet. Off-chain tickets are very flexible, allowing automation of on-chain rewards for any activity. Tickets are issued with a nonce, which allows effective invalidation of expired or invalid tickets by using a ticket with a higher nonce.

The last, but not the least is VirtualDistributor to allocate rewards to attributes in NFT metadata. At LE7EL, we use it to distribute $L7L rewards to avatar NFT holders based on their level. It implements business logic of battle-tested SushiChefv2 staking contract for any kind of competitive token rewards allocated to NFTs instead of wallets.

Agents

You might be wondering, do I have to sign every distribution with my manager wallet? What if our game has dozens of activities that we want to reward? Depending on your use case and frequency of rewards, you may keep self-custody and sign all rewards with your DAO, Gnosis safe or a cold wallet for extra security. You can also create an agent wallet with LE7EL, which will be controlled by a wallet in your self-custody.

Agent is a special service with a shared wallet generated with ECDH secret. On LE7EL side, we use AWS KMS to manage the master key in a cold storage and generate a derived signing key for each agent. So even if LE7EL is not available, you’ll be able to recover the private key for your agent’s wallet. While this solution has some obvious drawbacks compared to full self-custody, it’s much better than storing your private key in some configuration file of your automation script.

Our recommendation is manual rewards management if it’s not tedious for you, otherwise use our agent solution if you want full automation of reward distribution.

You can always seamlessly switch on-chain ownership of your reward contracts between agent’s and manager wallet using LE7EL UX.

We are researching possibility to provide access to our agent solution as LLM plugin to allow AI agents operate with their own crypto wallets.

Additional Tools

  • Our Escrow protocol received a 75k USDC grant from Aragon and was audited by Coinspect. This protocol allows to transact tokens securely using human-readable agreements which can be disputed by a mutually agreed arbiter or executed automatically if fully on-chain criteria is set by the escrow party (e.g. transaction of tokens for the complex NFT deal). Aragon Court, Kleros, DAO, multisig or an arbitary wallet can be used as an arbiter for human-readable agreement. This protocol is fully integrated into LE7EL chat, but you can develop a custom UX as well, all the data is stored on-chain.
  • Generators is a simple API service to create and deploy your own tokens. You can consider integrating it into your game or dApp if you don’t need heavy customisations to the base contracts (taxes, seizures etc).
  • Generative Art is a simple library to generate on-chain graphics with SVGs stored on-chain to visualise NFT collections like BAYC, Moonbirds etc.
  • Risk engine when you wish to implement trustless lottery or other risk mechanics using Chainlink’s VRF or custom randomness source.

About LE7EL

LE7EL is an ever-expanding multiverse of interconnected user-curated games and experiences owned by their Creators and/or Player communities. Technically, it consists of three parts: protocol, game clients, and tools.

LE7EL seeks to accomplish the following:

  • Make game creation more accessible for non-professionals such as gamers,
  • Maximize the creative potential of professional game developers,
  • Streamline user onboarding by providing interoperability and optional interconnection between different games,
  • Mitigate excessive value extraction by game publishing platforms,
  • Reduce maintenance expenses for all network participants,
  • Balance the interests of all main stakeholders and fair value distribution between them.

The end goal for LE7EL is a cohesive, user-owned network of games operated on a public infrastructure, supplied by anyone in a permissionless way using the LE7EL protocol.

Website | Docs | Twitter | Discord

About Polygon Labs

Polygon Labs develops Ethereum scaling solutions for Polygon protocols. Polygon Labs engages with other ecosystem developers to help make available scalable, affordable, secure and sustainable blockchain infrastructure for Web3.

Polygon Labs has initially developed a growing suite of protocols for developers to gain easy access to major scaling solutions, including layer 2s (zero-knowledge rollups), sidechains, app-specific chains and data availability protocols. Scaling solutions that Polygon Labs initially developed have seen widespread adoption with tens of thousands of decentralized apps, unique addresses exceeding 261 million, over 1.4 million smart contracts created and 2.7 billion total transactions processed since inception. The existing Polygon network is home for some of the biggest Web3 projects, such as Aave, Uniswap, QiDao and OpenSea, and well-known enterprises, including Robinhood, Stripe and Adobe. Polygon Labs is carbon neutral with the goal of leading Web3 in becoming carbon negative.

If you’re an Ethereum Developer, you’re already a Polygon developer! Leverage Polygon’s fast and secure txns for dApps you develop, get started here.

Website | Twitter | Developer Twitter | Telegram | LinkedIn | Reddit | Discord | Instagram | Facebook

--

--

LE7EL

Empowering Players & Creators in the Metaverse