Skip to content

Commit 68d662e

Browse files
author
Maksim Kiselev
authored
Merge pull request #365 from Azuro-protocol/feature-contracts_update
Feature contracts update
2 parents 9342891 + 42d83dc commit 68d662e

File tree

12 files changed

+362
-207
lines changed

12 files changed

+362
-207
lines changed

pages/hub/blockchains/_meta.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
22
"get-started": "Getting Started",
33
"architecture": "Azuro Architecture",
4+
"bet-functions": "Bet functions",
5+
"paymaster-funds": "PayMaster functions",
46
"deployment-addresses": "Deployment Addresses",
57
"audits": "Audits",
68
"errors-handling": "Errors Handling"

pages/hub/blockchains/architecture.mdx

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,41 @@ The Factory is the starting point in Azuro's architecture, allowing for the crea
2222

2323
The LP contract manages the pools and contains the logic for the betting system, empowering users to engage confidently in the ecosystem.
2424

25-
Key functions within this contract handle the creation and cancellation of games, the addition of liquidity, the placing of bets, and the payout processes.
25+
Key functions within this contract handle the addition of liquidity, the placing of bets, the payout processes and fee accumulating.
2626

27-
This contract is an integration point for various other contracts in the Azuro architecture, including the Factory, Access, and Betting Engines, indicating its critical position in the overall system. It showcases the ability to interact with other components like data providers and affiliates, demonstrating the modular and interconnected nature of Azuro's smart contract ecosystem.
27+
This contract is an integration point for various other contracts in the Azuro architecture, including the Factory, Access, and Betting Core Engine, Vault, indicating its critical position in the overall system. It showcases the ability to interact with other components like data providers and affiliates, demonstrating the modular and interconnected nature of Azuro's smart contract ecosystem.
28+
29+
#### Vault Contract
30+
The Vault contract is a liquidity store that manages the addition/removal of deposits and distributes protocol's profits/losses fairly.
31+
32+
Vault based on [LiquidityTree](https://gem.azuro.org/knowledge-hub/how-azuro-works/liquidity-tree).
2833

2934
#### Access Contract
3035

3136
The Access contract in Azuro's architecture is a critical component designed to manage access control to various functionalities within the ecosystem.
3237

3338
The contract uses a token-based system where each token represents a role with associated permissions. The binding of roles to contract functions and the assignment of roles to user accounts are central features that enforce the access control logic.
3439

35-
#### Prediction Engines
40+
[Access](https://github.com/Azuro-protocol/Access) contract is standalone open source project created and backed by Azuro team.
41+
42+
#### LiveCore contract
43+
44+
The LiveCore contract is a contracts that encompass the logic of creating [Conditions](https://gem.azuro.org/knowledge-hub/how-azuro-works/components/conditions), accepting bets, computing payouts for bets, and calculating [App rewards](https://gem.azuro.org/knowledge-hub/how-azuro-works/reward-distribution).
45+
46+
These contracts are plugged into the [Pool](https://gem.azuro.org/knowledge-hub/how-azuro-works/components/pools) by its owner via the [Factory](/hub/blockchains/architecture#factory-contract), and access to place bets and withdraw payouts is only granted through the [LP](/hub/blockchains/architecture#lp-contract) contract for which it was deployed or through PayMaster for freebets case.
47+
48+
The LiveCore contract supports pre-match and live betting condition types and ordinary/combo bets kinds.
49+
50+
#### Relayer contract
51+
52+
The Relayer contract is entry point for executing all types protocol bets.
53+
54+
The Relayer contract gets (if needed) sponsored transaction fee and sponsored amounts for the bet from the PayMaster contract.
55+
56+
Bettor not executes bet transaction by itself, he fills up bet parameters and sign it, next prepared bet order executes on the Relayer contract by special relayer-executor - this approach allow make bets totally free.
3657

37-
A Prediction Engine (aka Betting Engine) is a collective term for contracts that encompass the logic of creating [Conditions](https://gem.azuro.org/knowledge-hub/how-azuro-works/components/conditions), accepting bets, computing payouts for bets, and calculating [App rewards](https://gem.azuro.org/knowledge-hub/how-azuro-works/reward-distribution).
58+
#### PayMaster contract
3859

39-
These contracts are plugged into the [Pool](https://gem.azuro.org/knowledge-hub/how-azuro-works/components/pools) by its owner via the [Factory](/hub/blockchains/architecture#factory-contract), and access to place bets and withdraw payouts is only granted through the [LP](/hub/blockchains/architecture#lp-contract) contract for which it was deployed.
60+
The PayMaster contract combines sponsored fee vaults and freebet vaults for all affiliates, so every affiliate can manage (deposit/withdraw) its owned vaults in the contract.
4061

41-
A Betting Engine can inherit the [CoreBase](https://gem.azuro.org/contracts/core-base) contract that contains the fundamental logic to facilitate the betting process on multi-outcome Conditions.
62+
Also PayMaster in case of provided freebets completely manage it, because of freebet bets belongs PayMaster, so all freebet payouts must be done in PayMaster.

pages/hub/blockchains/audits.mdx

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { Card } from 'components'
22

33
# Audits
44

5+
## Protocol version V2
56
<div className="grid lg:grid-cols-3 gap-3 mt-5">
67
<Card
78
contentIcon="/images/svg/github.svg"
@@ -47,4 +48,32 @@ import { Card } from 'components'
4748
text="June 2024"
4849
toTab="https://github.com/Azuro-protocol/gem-docs/blob/main/public/files/HYDN%20-%20Azuro%20V2%20Audit%20Report.pdf"
4950
/>
50-
</div>
51+
</div>
52+
53+
## Protocol version V3
54+
<div className="grid lg:grid-cols-3 gap-3 mt-5">
55+
<Card
56+
contentIcon="/images/svg/github.svg"
57+
title="HEXENS"
58+
text="March 2025"
59+
toTab="https://github.com/Azuro-protocol/gem-docs/blob/main/public/files/V3-HEXENS.pdf"
60+
/>
61+
<Card
62+
contentIcon="/images/svg/github.svg"
63+
title="Pessimistic"
64+
text="March 2025"
65+
toTab="https://github.com/Azuro-protocol/gem-docs/blob/main/public/files/V3-Security-Analysis-Pessimistic.pdf"
66+
/>
67+
<Card
68+
contentIcon="/images/svg/github.svg"
69+
title="Maxim Timofeev Protocol Audit Report"
70+
text="March 2025"
71+
toTab="https://github.com/Azuro-protocol/gem-docs/blob/main/public/files/V3-Azuro-03-25-report.pdf"
72+
/>
73+
<Card
74+
contentIcon="/images/svg/github.svg"
75+
title="Maxim Timofeev contract PayMaster"
76+
text="April 2025"
77+
toTab="https://github.com/Azuro-protocol/gem-docs/blob/main/public/files/V3-PayMaster-04-25-report.pdf"
78+
/>
79+
</div>

pages/hub/protocol-v3/v3-smartconrtact-changes.mdx renamed to pages/hub/blockchains/bet-functions.mdx

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,10 @@
11
import { Callout } from 'components'
22

3-
# Azuro Protocol V3: Changes to smart contracts
4-
5-
## Bets improvements
6-
7-
In the V2 protocol, bets on pre-match, live and combo events processed in different contracts, with different betting logic, which added complexity to the protocol. In the new version V3, all types of bets (pre-match, live, combo) are processed by a single contract, which allows:
8-
- pre-match events become live events with the onset of a sporting event
9-
- combo bets can be made up of pre-match and live events
10-
- added the ability to accept bets from smart wallets (wallets smart contracts)
11-
- bets are placed by special bet executors, and the ability to provide gas-free transactions has been added
12-
133
## Placing bet and paying out
144

155
Placing a bet occurs in several stages:
166
- bettor approves token spending (for the bet) for the *Relayer contract* (entry point for bets)
17-
- bettor forms the bet parameters and signs (using EIP-712 standard) it in the WEB3 wallet. *All betting in V3 is done in the same way as V2 "live betting", using the EIP-712 parameters signing*
7+
- bettor forms the bet parameters and signs (using EIP-712 standard) it in the WEB3 wallet. *All betting is done, using the EIP-712 parameters signing*
188
- bettor transfers the signed data to the oracle via API
199
- oracle signs received data, forms and transfers the order to the executor (Relayer Executor)
2010
- the executor (Relayer Executor) execute transaction call of `function betFor(OrderData[] orders)` method of *Relayer contract*, `orders` contains the user's bet data, placing the bet
@@ -35,7 +25,7 @@ struct ConditionData {
3525
ConditionKind conditionKind;
3626
uint64[] odds;
3727
uint128[] outcomes;
38-
uint128 payoutLimit;
28+
uint128 potentialLossLimit;
3929
uint8 winningOutcomesCount;
4030
}
4131
@@ -59,8 +49,8 @@ event NewLiveBet(
5949
uint256 nonce,
6050
uint128 amount,
6151
SubBetData[] betDatas, // one record for ordinary, many records for combo
62-
uint128 payoutLimit
63-
)
52+
uint128 potentialLossLimit
53+
);
6454
6555
struct SubBetData {
6656
uint256 gameId;
@@ -81,8 +71,11 @@ event ConditionCreated(
8171
)
8272
```
8373

84-
## Payout on winning bet (same as in V2)
85-
If the bet wins, the user withdraw payout executing `lp.withdrawPayout(address core, uint256 tokenId)` for single bet or use batch analog `withdrawPayouts(address core, uint256[] calldata tokenIds)`
74+
## Payout on winning bet placed
75+
76+
If the bet wins, the user withdraw payout.
77+
### without freebets
78+
User withdraw payout executing `LP.withdrawPayout(address core, uint256 tokenId)` for single bet or use batch analog `withdrawPayouts(address core, uint256[] calldata tokenIds)`
8679
The winnings are paid to the owner of the bet token and the BettorWin() event is emitted for each token
8780
```solidity
8881
event BettorWin(
@@ -92,3 +85,14 @@ event BettorWin(
9285
uint256 amount
9386
)
9487
```
88+
### using freebet funds
89+
User withdraw payout executing batch function `PayMaster.withdrawPayouts(uint256[] calldata freeBetIds)` passing freebet ids.
90+
The winnings are paid to freebet ids owner and the BettorWin() event is emitted for each freebet id
91+
```solidity
92+
event BettorWin(
93+
address indexed core,
94+
address indexed bettor,
95+
uint256 indexed freeBetId,
96+
uint256 amount
97+
)
98+
```

pages/hub/blockchains/deployment-addresses.mdx

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,105 +10,113 @@ import { Callout } from 'components'
1010
<ContractsAddresses
1111
tabs={[
1212
{
13-
chain: 'Polygon Amoy v3.0.12',
13+
chain: 'Polygon Amoy v3.0.13',
1414
addresses: {
1515
lp: '0x0a75395Ff15d9557424b632cEBCac448D66F9779',
1616
vault: '0x1Ed6CEEDf7033461a189FD7c3381C34846D7b25a',
1717
clientCore: '0xCD0Db5ef28C3Bd3a69283372dE923Eb4DA0585F6',
1818
betToken: '0xCf1b86ceD971b88C042C64A9c099377e2738073C',
1919
azuroBet: '0x4B75c071dFA5d537979E8b0615Bb97B6337dbFef',
2020
relayer: '0x48c9bE88706F22838070eE7C4bC74Ad7A8eeF114',
21+
paymaster: '0x2d155962b708c931Fc695F674B415065E78D9F04',
2122
cashout: '0x7dF132Ad2334a667A004049a75a4a8a530dc24F2',
2223
},
2324
},
2425
{
25-
chain: 'Gnosis Dev v3.0.12',
26+
chain: 'Gnosis Dev v3.0.13',
2627
addresses: {
2728
lp: '0x0C2F50DCE97a4e327f5580bA4aad4E48d27f6DbD',
2829
vault: '0xf4cFe9e703fe24E4Bc4c6dc6678e33Bf08d1F629',
2930
clientCore: '0x12d5E6d2e9c47015C26a7c959a5Db42E3eF5a1Ef',
3031
betToken: '0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d',
3132
azuroBet: '0x9407B57bF56292b0d9940Ed69D9a74ACffb11413',
3233
relayer: '0x7C9C7B37C93EbC2103061834eb2781809f604eAf',
34+
paymaster: '0x943dD83042572226eFc485AD7Ecc605DFF7D2172',
3335
cashout: '0xF8E7F2e4693DBEd186b302474EeE5AE4Ab2E0150',
3436
},
3537
},
3638
{
37-
chain: 'Base Sepolia v3.0.12',
39+
chain: 'Base Sepolia v3.0.13',
3840
addresses: {
3941
lp: '0x4fE86EddCC22dc992b7994878169201Ec7ea50AB',
4042
vault: '0x6910dE58f350CE0A8b42D27004313346A31b3540',
4143
clientCore: '0x679CC42F69F98631668348d088086359D4217Ffa',
4244
betToken: '0x9e09f213Ff75e53D52e9e777A6567A68683E935f',
4345
azuroBet: '0xD031C4BDd4b7c30e3725132109786B8E158A4c07',
4446
relayer: '0x2De54cABa6A8198D9Dc51931485Bfdc8017aB0c5',
47+
paymaster: '0xC2577cdcF684C9756f2C81efdA001CbEFEf3Dd92',
4548
cashout: '0xf52Eb6ec19d81Ea623A7d7Ad397287C0C40f2F37',
4649
},
4750
},
4851
{
49-
chain: 'Chiliz Spicy v3.0.12',
52+
chain: 'Chiliz Spicy v3.0.13',
5053
addresses: {
5154
lp: '0x431A0993d29eEb0fF7e3FE351A303eF72195431a',
5255
vault: '0x2d76265b15081581F7ccD116828F35dA654f0a79',
5356
clientCore: '0x524994dcA5EA2bc979ac5506E7195F28B4c16932',
5457
betToken: '0x721EF6871f1c4Efe730Dce047D40D1743B886946',
5558
azuroBet: '0xF7815889e5d0635A31eca34390b25d8D2cEeD902',
5659
relayer: '0x725ec0A9eC9dC993A86d0eFD7fD78929d226AbE7',
60+
paymaster: '0x3df16FB8Dc28F63565AF2815E04a3368360FFd23',
5761
cashout: '0x7c771a200EcD61A01af992360303f7b1465Cd8e3',
5862
},
5963
},
6064
]}
6165
/>
6266

63-
### Contracts (Production)
67+
## Contracts (Production)
6468

6569
<ContractsAddresses
6670
tabs={[
6771
{
68-
chain: 'Polygon v3.0.12',
72+
chain: 'Polygon v3.0.13',
6973
addresses: {
7074
lp: '0x0FA7FB5407eA971694652E6E16C12A52625DE1b8',
7175
vault: '0x1a0612FE7D0Def35559a1f71Ff155e344Ae69d2C',
7276
clientCore: '0xF9548Be470A4e130c90ceA8b179FCD66D2972AC7',
7377
betToken: '0xc2132D05D31c914a87C6611C10748AEb04B58e8F',
7478
azuroBet: '0x7A1c3FEf712753374C4DCe34254B96faF2B7265B',
7579
relayer: '0x8dA05c0021e6b35865FDC959c54dCeF3A4AbBa9d',
80+
paymaster: '0xeD5760fC2d2f6d363d73e576173e5e8Ca6A877e1',
7681
cashout: '0x4a2BB4211cCF9b9eA6eF01D0a61448154ED19095',
7782
},
7883
},
7984
{
80-
chain: 'Gnosis v3.0.12',
85+
chain: 'Gnosis v3.0.13',
8186
addresses: {
8287
lp: '0xeb7cDA87D00d677A6Dc73EB569723b0fA51D97E7',
8388
vault: '0x14564e6BbbB8DE2f959af8c0e158D334F05393Bb',
8489
clientCore: '0x0e00E6ffcb5E207B800eec9e02999D1Fd9e448f2',
8590
betToken: '0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d',
8691
azuroBet: '0xd7cd9342A14962C2dCB14569CB6fcA2759999089',
8792
relayer: '0x40eb85018fA18dDd10a433C8c40ca8D6744d8B32',
93+
paymaster: '0x3Ebf1a2005f1a87862d61022a5BAC661994dD94e',
8894
cashout: '0x25de227af58188e656524d1C32cCf7C078cdC891',
8995
},
9096
},
9197
{
92-
chain: 'Base v3.0.12',
98+
chain: 'Base v3.0.13',
9399
addresses: {
94100
lp: '0x1eD7368bc515E928A4007cEa61FB8a6F8863Af87',
95101
vault: '0xbA390F464395fC0940c0B9591847ad4E836C7A0c',
96102
clientCore: '0xF40cF1dD7d16C098cff5F8B5650A8FaEf1F4640d',
97103
betToken: '0x4200000000000000000000000000000000000006',
98104
azuroBet: '0xF328404Dbc8c997d12dC55a1A179AF7F8cb7df90',
99105
relayer: '0xD2D508d66dB4fCE4B384e4C3EA2fa53BA43e73b5',
106+
paymaster: '0x4a2BB4211cCF9b9eA6eF01D0a61448154ED19095',
100107
cashout: '0x6EDff24761F4473611B45BDAe4a779ff31af14Be',
101108
},
102109
},
103110
{
104-
chain: 'Chiliz v3.0.12',
111+
chain: 'Chiliz v3.0.13',
105112
addresses: {
106113
lp: '0xEf6b12580301b04CD2551182C88623524B6e47b8',
107114
vault: '0x32696E01c979E3F542EC49D95729f011eF8F3c28',
108115
clientCore: '0xa5061617Ee6565CF48d7f0FEF06910b9fb9dE2b0',
109116
betToken: '0x677F7e16C7Dd57be1D4C8aD1244883214953DC47',
110117
azuroBet: '0x3777B4F27F4B36f14454dbB1f79278bcba694B52',
111118
relayer: '0x81F72B93ABaf061535aaF5D831F05e0CC4084b32',
119+
paymaster: '0xB3AE923721e8f3345654eFffC09f6F52afC21F4c',
112120
cashout: '0x3995eebB51793Ee353162E7400DB455B17dE3692',
113121
},
114122
},

0 commit comments

Comments
 (0)