Buenos Aires - Guadalajara
Bondly was deployed on Avalanche
πΊπ»πΊ Fuji testnet:
Addresses of the deployed contracts:
- Bondly Address: 0xb734eb2e370735d2e27e4E133534B6b848e7fBa1
- USDT dummy: 0x9fea0ED05e44A6b759fa1f9C5228b464Bf31C1cB
The backend for the Bondly app is composed by two blocks:
- The
Bondly
smart contract. - The Cedalio database.
In order to relate the information between the two backends we are using the id
s in UUID created by Cedalio. An example looks:
{
"id": "207760f2-fdd3-4397-80cc-a51093ccbf18"
}
Run the contract tests.
$ npx hardhat test
Bondly App - Test Suite for Modular Hackathon π·
Deployment
β Should be deployed with the correct params. (949ms)
β Should have a correct initial setup. (200ms)
Create, approve and reject Movements
β Should create a movement. (61ms)
β Should approve a movement. (113ms)
β Should reject a movement, but after 2nd approval, send the funds. (141ms)
β Should reject a movement altogether and return the funds to the Organization. (126ms)
6 passing (2s)
Complile the schema.
cedalio compile --schema-file data/schema.graphql
Run a local hardhat node. The configuration force mining 1 block per second.
npx hardhat node --config ./hardhat.config.cedalio-node.js
Deploy.
cedalio deploy --fresh --schema-file data/schema.graphql --network hardhat
## IMPORTANT: The prompt will ask you to give a name to the schema.
cedalio serve --schema-name schema
Create the principal objects to generate an ID the users could use in the smart contract.
# Create an Organization
mutation {
createOrganization(organization: {
name: "My First Organization"
owners: ["alice.address", "bob.address", "carl.address"]
}) {
txHash
organization {
id
}
}
}
After running the mutation, this is what you expect to see after running the query.
{
"data": {
"createOrganization": {
"organization": {
"id": "c9dfdef5-4977-4467-80b9-82453be07ec1"
}
}
}
}
Now, is time to create a new project.
mutation {
createProject(project: {
name: "Podcast Event"
description: "This is an event for a Web3 podcast."
start_datetime: "2023-04-04"
end_datetime: "2023-04-04"
budget: 300
organization: "c9dfdef5-4977-4467-80b9-82453be07ec1"
}) {
txHash
project {
id
}
}
}
And last, create a new movement, to be submited to approval.
mutation {
createMovement(movement: {
title: "Pagar Pizzas"
description: "Las pizzas mas ricas del mundo"
amount: 199
token: "USDT"
content: "link/to/online/content"
pay_to_address: "pizzaShop.address"
tag: "comida"
organization: "c9dfdef5-4977-4467-80b9-82453be07ec1"
project: "fe2f8dfa-0c6e-4d60-ba62-efc1c1dcd712"
}) {
txHash
movement {
id
}
}
}
Smart contract was deployed in ETH Goerli.
Addresses of the deployed contracts:
- OrganizationVault: 0x9fea0ED05e44A6b759fa1f9C5228b464Bf31C1cB
- Goerli USDT Token: 0x509ee0d083ddf8ac028f2a56731412edd63223b9
Deployment transaction: https://goerli.etherscan.io/tx/0xe1de38996e9cf488e1832bda680b192e1542259ac0fb8e9d2143c85a1323ddec