The UAED Finance Protocol introduces a pioneering approach to lending and borrowing digital assets, centering around the UAED stablecoin. This white paper outlines the key functionalities and distinctive features of the protocol, highlighting its advancements compared to mainstream lending protocols such as Compound and Aave.
Abstract
UAED Finance is a cutting-edge lending protocol built on the Polygon network, designed to enable permissionless lending and borrowing of digital assets through smart contracts. This paper provides an overview of the protocol's mechanics and emphasizes its unique attributes that set it apart from traditional lending platforms
Introduction
UAED Finance operates as a Polygon-based lending protocol, accessible through open smart contracts. Users can easily interact with the protocol through the user-friendly interface at https://uaed.finance/dapp. Alternatively, other interfaces like https://instadapp.io/ and https://etherscan.io/ can also be utilized.
UAED Stablecoin
UAED stablecoin introduces stability measures and anti-inflation safeguards by employing a decentralized approach to minting and burning tokens. The process is facilitated by the UAEDmanager smart contract, responsible for managing the creation and destruction of UAED tokens. Depositing USDC into UAEDmanager initiates the minting of UAED tokens at a fixed ratio of 0.27:1. Crucially, the deposited USDC is secured within UAEDmanager, enhancing stability and security. Users can also reverse this process, transferring UAED tokens back to the UAEDmanager smart contract. This initiates the burning of UAED tokens, reducing circulating supply, and releasing locked USDC at a ratio of 1:0.27. This mechanism maintains a balanced UAED token to locked USDC ratio, ensuring UAED's stability.
Pegging UAED to USDC
Opting for USDC over USDT brings advantages like regulatory compliance, transparency, stability, and banking partnerships. USDC is regulated by Circle, abides by US financial regulations, and undergoes regular audits. The protocol ensures a robust 1:1 peg, enhancing user trust and minimizing legal risks.
Investing and Charging the Protocol Pool
UAED Protocol facilitates lending by depositing funds into the protocol pool, streamlined in a single transaction. Borrowers can withdraw liquidity, which accrues interest over time, increasing the protocol pool's overall assets.
Protected Collateral
UAED Finance offers a unique "protected" state for deposited collateral. While Compound and Aave use all collateral for lending, UAED Finance allows collateral to remain protected, immune to borrower default risks. This collateral can be withdrawn instantly.
Flash Loans
UAED Finance supports flash loans, enabling users to borrow significant funds without collateral. These loans offer opportunities for complex operations like arbitrage and leverage trading, contributing to efficient and capital-effective DeFi strategies.
Decentralized Price Oracles
UAED Finance leverages Chainlink's Decentralized Price Oracles for real-time, reliable asset price data. This integration ensures accurate valuations, loan-to-value ratios, and risk management, enhancing the protocol's security and transparency.
Collateral Factor
The collateral factor in UAED Finance protocol determines the percentage of an asset's value available as collateral for borrowing. This mechanism balances risk and borrowing capacity, contributing to the protocol's security.
Liquidations
UAED Finance enforces liquidations when borrower debt surpasses collateral value. This process involves selling collateral to repay the debt, safeguarding lenders from potential losses due to undercollateralization.
Interest Rates
UAED Finance introduces steady interest rates, eliminating the complexities of fluctuating rates. This offers stability and predictability, enhancing the user experience.
Gas Optimizations
The smart contracts of UAED Finance are designed for maximum efficiency and cost-effectiveness. With storage optimization, a modular approach, and gas usage optimization, the protocol ensures smooth and affordable transactions.
Transaction Compression
UAED stablecoin implements transaction compression, reducing the need for multiple transactions. This optimizes interaction with DeFi protocols, enhancing user convenience and efficiency.
The UAED Finance Protocol redefines lending and borrowing in the DeFi space by incorporating innovative features and mechanisms, offering users enhanced security, efficiency, and stability.
Deployment Addresses
For those interested in exploring the UAED Finance protocol on different networks, here are the deployment addresses for the respective networks:
0xFd5B9B6fed5c0e7019C57aC323C03d7C09CB5D0a
0xD95fDC9Bc15F1eC90a61c7899d133b9240D7dbA0
0xa5Ef5326Ea19cfFB6EE95627Eb10053D33521d34
0xc2FFE86B24D46c89E78a477349387C914eD299C4
0x3De0A86E9C26a46407b65E178c9FF61412972854
0xec54a83359e49e4830314dd0DAC7c0e6867A35C9
0xEe55CE216D1Fe9Ee9082d930bC229e8ffdB730e3
0x71B47184e4D85f02E00B007aE6d7d2aB394759A6
Test Results
UAED> truffle test test/protocol.js
Compiling your contracts...
===========================
> Compiling .contractsECDSA.sol
> Compiling .contractsMigrations.sol
> Compiling .contractsUAED.sol
> Compiling .contractsUAEDProtocolRequestor.sol
> Compiling .contractsUAEDfinancePool.sol
> Compiling .contractsUAEDfinancePoolManager.sol
> Compiling .contractsUAEDfinancePrices.sol
> Compiling .contractsUAEDfinanceProtocol.sol
> Compiling .contractsUAEDmanager.sol
> Compiling .contracts estHelperPriceFeed.sol
> Compiling .contracts estHelperPriceFeed.sol
> Compiling .contracts estHelperUAEDtestHelper.sol
> Compiling .contracts estHelperlashLoanTester.sol
> Compiling .contracts estHelper okensUSDC.sol
> Compiling .contracts estHelper okensUSDC.sol
> Compiling .contracts estHelper okensWBTC.sol
> Compiling .contracts estHelper okensWBTC.sol
> Compiling .contracts estHelper okensWETH.sol
> Compiling .contracts estHelper okensWETH.sol
> Compilation warnings encountered:
> Compiled successfully using:
- solc: 0.8.19+commit.7dd6d404.Emscripten.clang
✓ Transaction submitted successfully. Hash: 0xb73e9a14b34f050b6f816936cc7292539ff41104ae047236ebecd3889acb4274
✓ Transaction submitted successfully. Hash: 0x7cfe5cd47aef66980dfeb985dbb57b0af3387e3c791ab67e626f0f669aa629d8
Contract: protocol
-----date & available accounts---------
date : 2023-08-17 07:15:36
[
'0xa558c5F048A0A8fd657D9b4944Cca3beD67aC2c0',
'0xf70690dE0Bc21Dbc6f5B28c8CF08136aAe3fA92F',
'0x48D7FCBBFeE50F4536139F3F7D04D3dF0F62Ef5C',
'0x10a01350Ebf46b9B8070DFB2ABC5A19FFd381e6d',
'0x83b4D4bE7Df680d5AA6daAC7dC83A45E7EC09406',
'0x0d49e149068723d2431124b46C44aC2F4D8AE2A4',
'0x9839A1D3625B48e4c8EfEf6b63d502bbC5df7Fbe',
'0x1f3b649FE21485CB9232487EEbaC096b57aF8E9c',
'0x0F4b4994c2Bc6F841Cb5AF7246cb770628b14741',
'0x4dBe881e28e3d395DC1f7F0649Cdc8109584d052',
'0x932F6F37c48F91FDFd73ef833e3F14Aa49dd88b4',
'0xb0966E49B544100A0887F4f1E595f4f22cCd92b4',
'0x7404C907ffFd5400D9A3F713f906212F8E313419',
'0x65be870CF9374D0a466Cae8205de72f97803De99',
'0xc8d8B59054490A9812c5c41F7433205C81Fef787',
'0xFeb68af8070E0022a61Fa8A9ED16296C746cbf9A',
'0xd63190960Ef4F2e10612c93fF5b821bF2B943C70',
'0x899C6b577Fa901Ac9cDF6aeDdb27B9dE2D4BeDd5',
'0x15e3f8B9Bc762f17E3852b4988B38274F58D9071',
'0xf544c0E5ed9f7895eb49aeAB7a58b25925aF3CA6'
]
__________initial settings__________
✓ Transaction submitted successfully. Hash: 0x66d98c16bc8743e0efa8b1e07659995209dcf8df0d09bb764f081022edd0ee0d
✓ Transaction submitted successfully. Hash: 0x03b864be4c1c448101fbbf2396d105a37726f6ed5ab36b6b7c45b35ed409dca3
✓ Transaction submitted successfully. Hash: 0x380eadc9b966173a1b02f9bb2c0c9961d7f253a8a06e17cdde14af14b7515085
✓ Transaction submitted successfully. Hash: 0x9da647dc29a1e38aeb12bfc59f65540fd256226e3c862695c5f9d2be08db8b50
✓ Transaction submitted successfully. Hash: 0x8320ad00ea80e0c427f35f838f429a090b8c0de1a3e91127fd5d82fe3a748b7b
----------UAED token details----------
name : UAE Dirham
symbol : UAED
decimals : 6
owner : 0x7a4BF57Ca7F42Ed60a6c0F0239016fB55fEA1cfD
address : 0x5EED45ead69616afb87e0771F2966B6a4Fd4E70b
--------------------------------------
UAEDmanager : 0x7a4BF57Ca7F42Ed60a6c0F0239016fB55fEA1cfD
UAEDfinanceProtocol : 0x677a0743f91A90d64B3Da663F734D2843e242333
UAEDfinancePool : 0x47ef43CA8776A1aaDdF9041eb7B303eeC1023A73
UAEDfinancePoolManager: 0x71091dAAc53b025136Dc631b917b3345dA9cCD37
UAEDProtocolRequestor : 0x0eA734925494f4B6f73f1107c3e3e790240e8211
USDC : 0x95293149291275a9e6D2da85eA1cfcC72ba2658F
WETH : 0xf04F14DB1246c6fA1C9503F3B54279fB81269336
UAEDtestHelper : 0xbf0dd80C622D82ddC93f60F076205e0c9640181E
√ step1: create main contracts (4243ms)
✓ Transaction submitted successfully. Hash: 0x4d0180f0a5a0489c64becb98acb912e371bcd7e641ec37f0c686736e8d6c6f60
✓ Transaction submitted successfully. Hash: 0xa251d488d7d9bf2940a0cfdbdb92db91c848a2a5e97f0fa14374c49e92f19870
✓ Transaction submitted successfully. Hash: 0xcf4c48ecbeefb033a3f41a345eb849997ba2966177110443466fc1e4dad2a9d3
------------PriceFeed contracts------------
ethPF: 0x7C59fD5437696eC5848a5a12D9d74D6cF9C7016D
uaedPF: 0xcf7F0a7B87115982d1316d6441449B004454D2e6
wethPF: 0x72Fa6cf5E90F90d6358f902BB6f987bCfaFb7490
-------------------------------------------
√ step2: create local priceFeed contracts (697ms)
✓ Transaction submitted successfully. Hash: 0x54d05b3efa641c2c66b2c81f2adffba14db9495f1094d131b221eb4de2cdc519
✓ Transaction submitted successfully. Hash: 0x0e1a9fb2d4813dec4da045de5b3f7471ff4ced46d1a71d8bcd66c67d98c7cf25
request1: 0x552bd0deaa23eba8b20993c9431786e95fd0a1c7e649f54d9178f53f9e0d817e
priceFeed1: 0x7C59fD5437696eC5848a5a12D9d74D6cF9C7016D
request2: 0x37b199711c76838baed2b78ed692f78b3aa934b3417ca6e92d47c66047c03d00
priceFeed2: 0xcf7F0a7B87115982d1316d6441449B004454D2e6
---------------time manipulation---------------
before : 2023-08-17 07:15:46
after : 2023-09-01 07:15:47
-----------------------------------------------
✖ Transaction submission failed with error -32000: 'VM Exception while processing transaction: revert wait more'
---------------time manipulation---------------
before : 2023-09-01 07:15:47
after : 2023-09-16 07:15:47
-----------------------------------------------
✓ Transaction submitted successfully. Hash: 0xc0bcff114c0dee661c1e3b872e5890cfe8793137125664037f5e2fe284f58245
✓ Transaction submitted successfully. Hash: 0xf901e352f59de138d6407d713727e9d2ee36fffce0fb68230647ef0d2f9c2df5
√ step3: set new priceFeeds (1800ms)
✓ Transaction submitted successfully. Hash: 0x64302607dc3c4d02364fd7312e0fc099c3622f7cb6fef4251497c42c8e862509
owner2 in protocol changed to : 0x65be870CF9374D0a466Cae8205de72f97803De99
√ step4: change protocol owner2 (201ms)
test poolManager contract : charge and discharge
2023-09-16 07:15:48
-------UAED details & balances-------
totalSupply : 0
pool : 0
investor1 : 0
investor2 : 0
-----------------------------
✓ Transaction submitted successfully. Hash: 0x75ca78345b117b1c5cccfef921900dd1babfcf41c048cd0f0659c29e521fea63
pool signer changed from 0xa558c5F048A0A8fd657D9b4944Cca3beD67aC2c0 to 0xFeb68af8070E0022a61Fa8A9ED16296C746cbf9A
✓ Transaction submitted successfully. Hash: 0x45f484f6868ecd3da2d1a20b6da7ab8436207855cf746294a50cf47b029927ed
✓ Transaction submitted successfully. Hash: 0x84d2887e5b1f0da6429917e2851f8307217269a8778ea90cad57637a33f536c6
✓ Transaction submitted successfully. Hash: 0x976757357141e6797448dabc947ae98f545910fd18cebc158fbdd3e2036eb651
✓ Transaction submitted successfully. Hash: 0x3930ed79b6cd403c6469702825c8c82cfb18084af9737f6eaddb52297daf0fd6
✓ Transaction submitted successfully. Hash: 0x7ceaa28741a07bcb16a25bac976b8527ecf9c3135421441775d644091bb7d29a
✓ Transaction submitted successfully. Hash: 0x27d4d9205144882b1f292fe7787735ad267639b96e425bfd184523a40c069a52
√ step5: change pool signer and charge investors (1962ms)
2023-09-16 07:15:51
-------UAED details & balances-------
totalSupply : 1100000
pool : 0
investor1 : 100000
investor2 : 1000000
-----------------------------
✖ Transaction submission failed with error -32000: 'VM Exception while processing transaction: revert signer != owner'
✓ Transaction submitted successfully. Hash: 0x3c13f4f0d6c055c61777c8f5be2fe5cf709a35c22a371810701e9918a30a27fd
----UAEDdeposit event -----
sender : 0xd63190960Ef4F2e10612c93fF5b821bF2B943C70
amount : 100000000000
---------------------------
signer: 0xFeb68af8070E0022a61Fa8A9ED16296C746cbf9A
---------------------------
balance: 100000000000
---------------------------
signature: 0x50a13fc04ff01d11956d7706e28c694a641b250b15192418a6af16f2ad4378e01566e674d534206d5c01d733bce95bd5941aae8df41d12cb108f5b68ee45e84c1c
√ step6: investor1 get signature from pool signer and charge pool for 100000 UAED (1125ms)
2023-09-16 07:15:52
-------UAED details & balances-------
totalSupply : 1100000
pool : 100000
investor1 : 0
investor2 : 1000000
-----------------------------
✓ Transaction submitted successfully. Hash: 0x1623bc7e86fd28bb699e9392b384bc4720e421a10c3ca005d2ff1cca83a6eeb8
----UAEDdeposit event -----
sender : 0x899C6b577Fa901Ac9cDF6aeDdb27B9dE2D4BeDd5
amount : 1000000000000
---------------------------
signer: 0xFeb68af8070E0022a61Fa8A9ED16296C746cbf9A
---------------------------
balance: 1000000000000
---------------------------
signature: 0x8df1f72f8d36cce6ac67a4a52fe6eca8cbd43e0d50ccbe6a6a902c899e822f0371afc74a1d65b0805d44d5bdfc420ee08fa45336f8910cc9dd01431a468e7e761c
√ step7: investor2 get signature from pool signer and charge pool for 1000000 UAED (698ms)
2023-09-16 07:15:54
-------UAED details & balances-------
totalSupply : 1100000
pool : 1100000
investor1 : 0
investor2 : 0
-----------------------------
seasonTimestamp: 2023-10-02 04:30:00
---------------time manipulation---------------
before : 2023-09-16 07:15:54
after : 2023-10-02 04:29:56
-----------------------------------------------
✖ Transaction submission failed with error -32000: 'VM Exception while processing transaction: revert only in seasonTimestamp'
---------------time manipulation---------------
before : 2023-10-02 04:29:56
after : 2023-10-02 04:30:02
-----------------------------------------------
✖ Transaction submission failed with error -32000: 'VM Exception while processing transaction: revert'
✓ Transaction submitted successfully. Hash: 0x0afbc4231f4d20124d4defe9c7ff5e17c19c3300c26a505f07d72838710446ba
---UAEDWithdrawal event---
receiver : 0xd63190960Ef4F2e10612c93fF5b821bF2B943C70
amount : 50000000000
--------------------------
investor1 UAED balance : 50000
✓ Transaction submitted successfully. Hash: 0x92f12cc763996cfac0638b1b7fd85d7d832c89707e12b85ea24879b923110407
---unconditional UAEDWithdrawal event---
receiver : 0xd63190960Ef4F2e10612c93fF5b821bF2B943C70
amount : 50000000000
--------------------------
investor1 UAED balance : 100000
√ step8: investor1 discharge pool (1809ms)
2023-10-02 04:30:02
-------UAED details & balances-------
totalSupply : 1100000
pool : 1000000
investor1 : 100000
investor2 : 0
-----------------------------
---------------time manipulation---------------
before : 2023-10-02 04:30:02
after : 2023-10-05 04:30:04
-----------------------------------------------
✖ Transaction submission failed with error -32000: 'VM Exception while processing transaction: revert only in seasonTimestamp'
√ step9: investor2 wants to discharge the pool but the trx reverts according to inappropriate time (439ms)
2023-10-05 04:30:04
-------UAED details & balances-------
totalSupply : 1100000
pool : 1000000
investor1 : 100000
investor2 : 0
-----------------------------
------investor1 balance------
UAED : 100000
USDC : 0
-----------------------------
✓ Transaction submitted successfully. Hash: 0xb1bfce9e7e4d7f03f50f39b2167f301ce4601a96bc373b9461d50164b66bf25c
------investor1 balance------
UAED : 99999.9
USDC : 0.027
-----------------------------
√ step10: investor1 send UAED to UAEDmanager contract and gives USDC in return (721ms)
__________test WETH__________
--------price snapshot---------
ETH/USD : 1200
UAED/USD : 0.3
WETH/USD : 1200
2023-10-05 04:30:05
-------balanceSnapShot-------
UAED totalSupply : 1099999.9
owner2 UAED balance : 0
pool :
UAED : 1000000
ETH : 0
WETH : 0
-----------------------------
✓ Transaction submitted successfully. Hash: 0x9a557899bb338430b74b49dccd11b49b5fd735304b55ec388e4608122a6c398c
WETH_WHALE WETH balance: 10
√ step11: WETH_WHALE received 10 WETH (371ms)
✓ Transaction submitted successfully. Hash: 0xb4f7968c9faf09ab64c9561098618e10ca9efe6f12462c903a4b7c4f7d0179b5
---------------time manipulation---------------
before : 2023-10-05 04:30:07
after : 2023-10-20 04:30:08
-----------------------------------------------
✓ Transaction submitted successfully. Hash: 0xa0b92bb6c605d8c9b53c973336c0b03bb2ec46f885d61266977264358ea7abcc
----------------------------------------------------
UAED contract now supports WETH as collateral!
assetId : 11
tokenAddress : 0xf04F14DB1246c6fA1C9503F3B54279fB81269336
priceFeed : 0x72Fa6cf5E90F90d6358f902BB6f987bCfaFb7490
collateralFactor : 90
----------------------------------------------------
√ step12: set WETH as supported collateral (1276ms)
✓ Transaction submitted successfully. Hash: 0x2b2f485b8c06c26ce7e73c20a5ed2afc74ae459735f12409e3c604fcc81db4ae
✓ Transaction submitted successfully. Hash: 0x48718bcd22f9b3250b8e3d62d25cb144a050ca63602f278202ee163869f0b11d
✓ Transaction submitted successfully. Hash: 0xfba2d75be51383f7c9860e3fbc31bff1696457179e0e3b4f3a1dbb975be451eb
✓ Transaction submitted successfully. Hash: 0x950d5cc0c7b26d649088897e7a568597437ba653b83d6271378b7dca9edf4c2d
✓ Transaction submitted successfully. Hash: 0xd246801da126e3b4d624005d19e3c46193c04da2034c423a1905b47ba5412719
✓ Transaction submitted successfully. Hash: 0x1e686e29eb14ab376621d6d91909fa4577361ac12cb528cbd8ceaeaf4710cdcf
✓ Transaction submitted successfully. Hash: 0xea3eaf9331006d1e26d567d2cef27ccea833602c2e9efae513502921f35d8119
✓ Transaction submitted successfully. Hash: 0x6abd748ca93cbd4f39b59bf78c7e3f83cf050f6b5fc2a4563440c942f1b4dea3
√ step13: transfer WETH to users and approve to UAED contract (2248ms)
user1 WETH balance : 1
✓ Transaction submitted successfully. Hash: 0xcff81005e1642e7e1abdf2c9dc97534f706521b2a64ae5cc7e116ca025047306
---------user1 pledged WETH and UAED minted---------
user address: 0xf70690dE0Bc21Dbc6f5B28c8CF08136aAe3fA92F
user gas used : 185374
assetId: 11
collateralAmount: 1
userCollateralPercentage: 80
UAED minted: 11851.851851
user UAED balance : 11851.851851
user WETH balance : 0
date : 2023-10-20 04:30:12
user2 WETH balance : 1
✓ Transaction submitted successfully. Hash: 0xb75aa096fb5486e41c0a8866ad54300e14ad026ebf7365e1e823a1d95bfd8c13
---------user2 pledged WETH and UAED minted---------
user address: 0x48D7FCBBFeE50F4536139F3F7D04D3dF0F62Ef5C
user gas used : 170374
assetId: 11
collateralAmount: 1
userCollateralPercentage: 80
UAED minted: 11851.851851
user UAED balance : 11851.851851
user WETH balance : 0
date : 2023-10-20 04:30:13
user3 WETH balance : 1
✓ Transaction submitted successfully. Hash: 0x86d4744d67f3c037cdf7f7f6f5ee17bbb05f51478534201dbcb7330533020bd1
---------user3 pledged WETH and UAED minted---------
user address: 0x10a01350Ebf46b9B8070DFB2ABC5A19FFd381e6d
user gas used : 170374
assetId: 11
collateralAmount: 1
userCollateralPercentage: 80
UAED minted: 11851.851851
user UAED balance : 11851.851851
user WETH balance : 0
date : 2023-10-20 04:30:14
user4 WETH balance : 1
✓ Transaction submitted successfully. Hash: 0x6bf91b6fcd4dfa1303ffee9fe7325ed99d71acf3de5a369b4141c4978e3925f5
---------user4 pledged WETH and UAED minted---------
user address: 0x83b4D4bE7Df680d5AA6daAC7dC83A45E7EC09406
user gas used : 170374
assetId: 11
collateralAmount: 1
userCollateralPercentage: 80
UAED minted: 11851.851851
user UAED balance : 11851.851851
user WETH balance : 0
date : 2023-10-20 04:30:15
-------balanceSnapShot-------
UAED totalSupply : 1099999.9
owner2 UAED balance : 0
pool :
UAED : 952592.592596
ETH : 0
WETH : 4
-----------------------------
√ step14: 4 users pledge 10 WETH and receive UAED (4119ms)
✓ Transaction submitted successfully. Hash: 0x30a42e5449acf3a768eaa47672df0aa7e77befbd94cd0374e2825b5483801463
✓ Transaction submitted successfully. Hash: 0x5addff3d07f95071568d9d869ee86c55bdef00563f36f2b416d4afbdbe51d32a
----------------------------------------------------
user2 pledged ETH and UAED minted:
user address: 0x48D7FCBBFeE50F4536139F3F7D04D3dF0F62Ef5C
assetId: 2
isPledgedBefore: true
pledgedAmount: 5
mintedUAED: 26666.666666
user UAED balance : 38518.518517
user ETH balance : 94.99231224
user gas used : 32735
----------------------------------------------------
-------balanceSnapShot-------
UAED totalSupply : 1099999.9
owner2 UAED balance : 0
pool :
UAED : 925925.92593
ETH : 5
WETH : 4
-----------------------------
√ step15: user 2 sends 5 ETH to contract (1200ms)
✖ Transaction submission failed with error -32000: 'VM Exception while processing transaction: revert Repetitious asset'
protocol balance : 0
pool balance : 925925.92593
liquidator balance : 0
✖ Transaction submission failed with error -32000: 'VM Exception while processing transaction: revert uninsolvent user'
✖ Transaction submission failed with error -32000: 'VM Exception while processing transaction: revert uninsolvent user'
protocol balance : 0
pool balance : 925925.92593
liquidator balance : 0
√ step16: check reverts 1) Repetitious asset as collateral 2) Liquidate solvent users (1462ms)
date : 2023-10-20 04:30:19
✓ Transaction submitted successfully. Hash: 0x789a6b97b308a1b073becec3e0efa8ad2208090e5ffeffb089d4866a5bb99b44
--------debt State SnapShot--------
user : 0xf70690dE0Bc21Dbc6f5B28c8CF08136aAe3fA92F
assetId : 11
debtAmount : 11851.851971
collateralValue : 14814.814814
isOverCollateralized : false
---------------time manipulation---------------
before : 2023-10-20 04:30:20
after : 2023-10-20 04:31:20
-----------------------------------------------
✖ Transaction submission failed with error -32000: 'VM Exception while processing transaction: revert ERC20: insufficient allowance'
✓ Transaction submitted successfully. Hash: 0xebff05c77d8f2969a7ff19eade02f3fa708ab8b2a0fd42416642139bb6f651da
✓ Transaction submitted successfully. Hash: 0x8ddc0e82678b25b2b13e6dff7d2ff003f96617581c2d9c47411944ecc171bf36
✓ Transaction submitted successfully. Hash: 0x1a98b4d32350dd489703fef63cdc9460ff1c194f729161c037b0b96324b9a3ea
user1 UAED balance : 11852.851851
user1 WETH balance : 0
owner2 UAED balance : 0
protocol balance : 0
pool balance : 925925.92593
✓ Transaction submitted successfully. Hash: 0xa1519cb94bf4a408a5d7174cb23a7ddf2968a39a3ee9e71362590da58c26c035
---------debtPaid event -----------
user : 0xf70690dE0Bc21Dbc6f5B28c8CF08136aAe3fA92F
--------------------
assetId : 11
--------------------
debtAmount : 11851852901
--------------------
timeStamp : 1697776282
user1 UAED balance : 0.99895
user1 WETH balance : 1
owner2 UAED balance : 0.00105
protocol balance : 0
pool balance : 937777.777781
✖ Transaction submission failed with error -32000: 'VM Exception while processing transaction: revert unpledged user'
√ step17: user 1 pays his debt in less than one hour (3640ms)
---------------time manipulation---------------
before : 2023-10-20 04:31:23
after : 2024-10-19 04:31:24
-----------------------------------------------
✓ Transaction submitted successfully. Hash: 0x50e7ee9bb69743144f9ceb2db58104f2d30254210c424f9d855854a6933db2d3
--------debt State SnapShot--------
user : 0x48D7FCBBFeE50F4536139F3F7D04D3dF0F62Ef5C
assetId : 11
debtAmount : 12325.28225
collateralValue : 14814.814814
isOverCollateralized : false
✖ Transaction submission failed with error -32000: 'VM Exception while processing transaction: revert uninsolvent user'
✓ Transaction submitted successfully. Hash: 0x0128ce1f733cb1d85a12b3fa15595167bef46be8b77faff00617ce34d72e5dcb
✓ Transaction submitted successfully. Hash: 0x20c6cf74d44010afde309510b9e1ac21151e8fce3472c91e60e4edf448c70e3a
✓ Transaction submitted successfully. Hash: 0x9de7024b7a58753419c25c752ae68b3f03c9018499970fc17fbd8fb11d6676e4
✓ Transaction submitted successfully. Hash: 0x6c4feb5a47215d9619d9a87c4ab8c5ee504162565f8e702eedd62765a14cbf2b
UAED minted to user2 : 12325243747
user2 UAED balance : 12325282265.518517
user2 WETH balance : 0
owner2 UAED balance : 0.00105
✓ Transaction submitted successfully. Hash: 0xc72eb20635300508bbc8e9be858f2b43f01fdc001664c1e9248d8ed2322887f3
---------debtPaid event -----------
user : 0x48D7FCBBFeE50F4536139F3F7D04D3dF0F62Ef5C
--------------------
assetId : 11
--------------------
debtAmount : 12325282295
--------------------
timeStamp : 1729312287
--------------------
user2 UAED balance : 12325269940.236221
user2 WETH balance : 1
owner2 UAED balance : 473.431494
protocol balance : 0
pool balance : 949629.629632
✖ Transaction submission failed with error -32000: 'VM Exception while processing transaction: revert unpledged user'
√ step18: user 2 pays his debt after 1 year (3940ms)
---------------time manipulation---------------
before : 2024-10-19 04:31:28
after : 2026-10-19 04:31:28
-----------------------------------------------
✓ Transaction submitted successfully. Hash: 0xa0656ac43e1d9cfd703b83f1f47e21614f7a6bd803bd79bec9de206be637e107
--------price snapshot---------
ETH/USD : 1200
UAED/USD : 0.3
WETH/USD : 1170
✓ Transaction submitted successfully. Hash: 0x65f5b9634906353a6d0693e2d85583e28055abf650e5495275c5193277a6726a
--------debt State SnapShot--------
user : 0x10a01350Ebf46b9B8070DFB2ABC5A19FFd381e6d
assetId : 11
debtAmount : 13272.140976
collateralValue : 14444.444444
isOverCollateralized : true
✓ Transaction submitted successfully. Hash: 0x6ff422a2f6cc3b728800879f8104ed6e32b9f72049a3158e6da38db51d20e75d
✓ Transaction submitted successfully. Hash: 0xf2c799a7f5d5d5d8d02a6d948f62d951a6853cfde3485c44b2ee0bfb7bb67229
✓ Transaction submitted successfully. Hash: 0x2c9231fc19a18e8e694ade09fa587d493ca16facae934b531e66a99e6a9496a5
✓ Transaction submitted successfully. Hash: 0x05910d9ea2ba6bd2638f329f85de0b62e9761766bbb95dfdd7c381100e7f6e41
liquidator balance before mint : 0
amount minted to liquidator : 13272140976
user3 DebtAmount : 13272.140976
user3 UAED balance : 11851.851851
user3 WETH balance : 0
liquidator WETH balance : 0
owner2 UAED balance : 473.431494
✓ Transaction submitted successfully. Hash: 0x6f2bdda7489a39b588df78fde5e98aece7ddfc36b18f9fb98499003755878803
---------userLiquidated event -----------
user : 0x10a01350Ebf46b9B8070DFB2ABC5A19FFd381e6d
--------------------
assetId : 11
--------------------
debtAmount : 13272.141006
--------------------
timeStamp : 1792384291
--------------------
liquidator gas used : 173212
user3 UAED balance : 11851.851851
user3 WETH balance : 0.0710145352406466
in UAED : 276.9566874385218
liquidator UAED balance : 13272127703.858994
liquidator WETH balance : 0.9289854647593534
in UAED : 3623.0433125614786
owner2 UAED balance : 1893.720649
✖ Transaction submission failed with error -32000: 'VM Exception while processing transaction: revert unpledged user'
√ step19: user 3 is underCollateralized so is liquidated (5013ms)
---------------time manipulation---------------
before : 2026-10-19 04:31:33
after : 2027-10-19 04:31:34
-----------------------------------------------
✓ Transaction submitted successfully. Hash: 0x9f7cce8637242beb8c6c7093361bd83654f911a4bc88f802693703155b6e318e
--------price snapshot---------
ETH/USD : 1200
UAED/USD : 0.3
WETH/USD : 1100
✓ Transaction submitted successfully. Hash: 0x9c970c87ee7f7bc5aa888f4e8e4152f2d591808bbd6c4a59018b3bdb4fd56d1c
--------debt State SnapShot--------
user : 0x83b4D4bE7Df680d5AA6daAC7dC83A45E7EC09406
assetId : 11
debtAmount : 13745.570385
collateralValue : 13580.246913
isOverCollateralized : true
✓ Transaction submitted successfully. Hash: 0x6c9a5812ed4545f3d776e9a7b93d96f8c9cf885fa5ca05e874f5337ae4923817
✓ Transaction submitted successfully. Hash: 0x5bdc6637899400239377a1a628f0aade9d9907325056faeeb1197501cd4c4d13
✓ Transaction submitted successfully. Hash: 0x66b1b32f1006d1f12c7bf3110744e29f09e1218cd8df3a28afe698ed2d4e087f
✓ Transaction submitted successfully. Hash: 0xe3e829b4d03d23c5b49da28ce0d89d5deded05904d7b5864d73f6e453b65e91d
liquidator balance before mint : 13272127703.858994
amount minted to liquidator : 473442682
user4 DebtAmount : 13745.570385
user4 UAED balance : 11851.851851
user4 WETH balance : 0
liquidator WETH balance : 0.9289854647593534
owner2 UAED balance : 1893.720649
✓ Transaction submitted successfully. Hash: 0x721ba40af6b0955f005d80c663ed5753ccb11543e309497c3d11a0856ddfc7b4
---------userLiquidated event -----------
user : 0x83b4D4bE7Df680d5AA6daAC7dC83A45E7EC09406
--------------------
assetId : 11
--------------------
debtAmount : 13745.570415
--------------------
timeStamp : 1823920297
--------------------
liquidator gas used : 89077
user4 UAED balance : 11851.851851
user4 WETH balance : 0
in UAED : 0
liquidator UAED balance : 13745556640.28858
liquidator WETH balance : 1.9289854647593534
in UAED : 7072.946704117629
owner2 UAED balance : 3787.439213
✖ Transaction submission failed with error -32000: 'VM Exception while processing transaction: revert unpledged user'
√ step20: user 4 is underCollateralized but isn't liquidated till the collateral value becomes less than debt! (4224ms)
__________test ETH__________
--------price snapshot---------
ETH/USD : 1200
UAED/USD : 0.3
WETH/USD : 1100
2027-10-19 04:31:38
-------balanceSnapShot-------
UAED totalSupply : 26071927405.9
owner2 UAED balance : 3787.439213
pool :
UAED : 973333.333334
ETH : 5
WETH : 0
-----------------------------
2027-12-02 11:59:56
✖ Transaction submission failed with error -32000: 'VM Exception while processing transaction: revert incorrect request time'
2027-12-02 12:00:01
✓ Transaction submitted successfully. Hash: 0x75057444ee225c81268337cbebdbe249f2853ecb48eb9809f7cc7cb3f642772f
request: 0x91cf3b60a512774309a19ceaad0b4958f47ebb2a339c6faf47f5488bc3498aa2
interestRatePerHour: 570
---------------time manipulation---------------
before : 2027-12-02 12:00:01
after : 2027-12-17 12:00:01
-----------------------------------------------
✖ Transaction submission failed with error -32000: 'VM Exception while processing transaction: revert incorrect request time'
✖ Transaction submission failed with error -32000: 'VM Exception while processing transaction: revert wait more'
---------------time manipulation---------------
before : 2027-12-17 12:00:01
after : 2028-01-01 12:00:02
-----------------------------------------------
✓ Transaction submitted successfully. Hash: 0x101b6ebdcb06f2a925ec3cca6f7e52c09c042393ff208d073e5f0fd8bd3fe0ca
√ step21: set annual interest rate to 5% (2053ms)
user4 ETH balance : 99.99457162
-------balanceSnapShot-------
UAED totalSupply : 26071927405.9
owner2 UAED balance : 3787.439213
pool :
UAED : 973333.333334
ETH : 5
WETH : 0
-----------------------------
✓ Transaction submitted successfully. Hash: 0x1244924a6a596dca39f46b51b67e4ef66413f34eb6e9d410eebddf4d4114f8e6
user4 pledged and UAED minted:
address: 0x83b4D4bE7Df680d5AA6daAC7dC83A45E7EC09406
assetId: 2
collateralAmount: 10
userCollateralPercentage: 65
UAED minted: 96296.296296
UAED balance : 108148.148147
ETH balance : 89.9912149
date : 2028-01-01 12:00:03
----------------------------------------------------
user5 ETH balance : 100
✓ Transaction submitted successfully. Hash: 0x9e793690bb2d1cbb776e112ec7498760c458b421f5e267b581d088be4ed5a782
user5 pledged and UAED minted:
address: 0x0d49e149068723d2431124b46C44aC2F4D8AE2A4
assetId: 2
collateralAmount: 10
userCollateralPercentage: 65
UAED minted: 96296.296296
UAED balance : 96296.296296
ETH balance : 89.99634328
date : 2028-01-01 12:00:04
----------------------------------------------------
user6 ETH balance : 100
✓ Transaction submitted successfully. Hash: 0x373e4ab2148189bc7ee1f0f35c43663f9b2e317b168e6a66db42c21ba4445e09
user6 pledged and UAED minted:
address: 0x9839A1D3625B48e4c8EfEf6b63d502bbC5df7Fbe
assetId: 2
collateralAmount: 10
userCollateralPercentage: 65
UAED minted: 96296.296296
UAED balance : 96296.296296
ETH balance : 89.99634328
date : 2028-01-01 12:00:05
----------------------------------------------------
user7 ETH balance : 100
✓ Transaction submitted successfully. Hash: 0x25a1d05aefb51dd9962706872bbe173d4364ce0c01796a23141a3a9d699a8449
user7 pledged and UAED minted:
address: 0x1f3b649FE21485CB9232487EEbaC096b57aF8E9c
assetId: 2
collateralAmount: 10
userCollateralPercentage: 65
UAED minted: 96296.296296
UAED balance : 96296.296296
ETH balance : 89.99634328
date : 2028-01-01 12:00:05
----------------------------------------------------
√ step22: 4 users pledge 10 ETH and receive UAED (3104ms)
✖ Transaction submission failed with error -32000: 'VM Exception while processing transaction: revert Repetitious asset'
-------balanceSnapShot-------
UAED totalSupply : 26071927405.9
owner2 UAED balance : 3787.439213
pool :
UAED : 588148.14815
ETH : 45
WETH : 0
-----------------------------
protocol balance : 0
pool balance : 588148.14815
liquidator balance : 13745556640.28858
✖ Transaction submission failed with error -32000: 'VM Exception while processing transaction: revert uninsolvent user'
✖ Transaction submission failed with error -32000: 'VM Exception while processing transaction: revert uninsolvent user'
protocol balance : 0
pool balance : 588148.14815
liquidator balance : 13745556640.28858
√ step23: check reverts : 1) Repetitious asset as collateral 2) Liquidate solvent users (1737ms)
date : 2028-01-01 12:00:08
⠸ Waiting for transaction signature. Please check your wallet for a transaction approval message.
-------balanceSnapShot-------
UAED totalSupply : 26071927405.9
owner2 UAED balance : 3787.439213
pool :
UAED : 588148.14815
ETH : 45
WETH : 0
-----------------------------
✓ Transaction submitted successfully. Hash: 0xecfd277729d0265edc3006bec2df6d4fdb3de10050e6d192c6690548b17d56f4
--------debt State SnapShot--------
user : 0x83b4D4bE7Df680d5AA6daAC7dC83A45E7EC09406
assetId : 2
debtAmount : 96296.29721
collateralValue : 148148.148148
isOverCollateralized : false
---------------time manipulation---------------
before : 2028-01-01 12:00:09
after : 2028-01-01 12:01:10
-----------------------------------------------
user4 UAED balance : 108148.148147
user4 ETH balance : 89.99030108000001
owner2 UAED balance : 3787.439213
protcol UAED balance : 0
✓ Transaction submitted successfully. Hash: 0xcf5646baea622302e2c9e4d30031448c18bb6f3a4b50a3c7313a739ae4e0eb31
---------debtPaid event -----------
user : 0x83b4D4bE7Df680d5AA6daAC7dC83A45E7EC09406
--------------------
assetId : 2
--------------------
debtAmount : 96296306511
--------------------
timeStamp : 1830340870
user4 UAED balance : 11851.841636
user4 ETH balance : 99.98814962
owner2 UAED balance : 3787.449428
protcol UAED balance : 0
√ step24: phase 5 : user4 pays his debt in less than one hour (1989ms)
---------------time manipulation---------------
before : 2028-01-01 12:01:10
after : 2028-12-31 12:01:12
-----------------------------------------------
-------balanceSnapShot-------
UAED totalSupply : 26071927405.9
owner2 UAED balance : 3787.449428
pool :
UAED : 684444.444446
ETH : 35
WETH : 0
-----------------------------
✓ Transaction submitted successfully. Hash: 0xc3b77e6e1d583a49bc60a38b46892b46c10e892abd21b2959153b3e3ae4d0af8
--------debt State SnapShot--------
user : 0x0d49e149068723d2431124b46C44aC2F4D8AE2A4
assetId : 2
debtAmount : 101104.57333
collateralValue : 148148.148148
isOverCollateralized : false
✖ Transaction submission failed with error -32000: 'VM Exception while processing transaction: revert uninsolvent user'
✖ Transaction submission failed with error -32000: 'VM Exception while processing transaction: revert ERC20: insufficient allowance'
✓ Transaction submitted successfully. Hash: 0x7aaa947a542cd6e58a9462caa924bfbb93406505a24e353641c357fbca505d77
✓ Transaction submitted successfully. Hash: 0x3f0a51f6c7e24d6d7dceaa439dbdfd368dc9228a8e6741d4694805f739cdde3e
✓ Transaction submitted successfully. Hash: 0x5f151bd0ab6ddfed14283a009ff2724b200a33743878173af53da33bf031d747
✓ Transaction submitted successfully. Hash: 0x89ef6ee1e143e9274f59e25cbb466fe7439e67369276d2166deaf3c2b50297d9
101104477187 UAED minted to user5
user5 UAED balance : 101104573483.2963
user5 ETH balance : 89.99400304
✓ Transaction submitted successfully. Hash: 0xf66460f4300d415977faf56e44c891a13a4a2061edc0327b448165a0d2a5c997
---------debtPaid event -----------
user : 0x0d49e149068723d2431124b46C44aC2F4D8AE2A4
--------------------
assetId : 2
--------------------
debtAmount : 101104573787
--------------------
timeStamp : 1861876875
--------------------
user5 UAED balance : 101104472378.72252
user5 ETH balance : 99.99185086
owner2 UAED balance : 8595.726919
owner2 ETH balance : 100
√ step25: phase 6 : user5 pays his debt after 1 year (4239ms)
---------------time manipulation---------------
before : 2028-12-31 12:01:15
after : 2029-12-31 12:01:17
-----------------------------------------------
-------balanceSnapShot-------
UAED totalSupply : 127176404592.9
owner2 UAED balance : 8595.726919
pool :
UAED : 780740.740742
ETH : 25
WETH : 0
-----------------------------
✓ Transaction submitted successfully. Hash: 0x266396cd3a974c5aa1bd78fe7922b9dfdbf3a4ff3a22d224647de7cced657e68
--------price snapshot---------
ETH/USD : 1170
UAED/USD : 0.3
WETH/USD : 1100
✓ Transaction submitted successfully. Hash: 0xdb03fcc23c91ce9ab07f6dfc2e8181e76a73ffd2f82d773fdc6614f264e2efce
--------debt State SnapShot--------
user : 0x9839A1D3625B48e4c8EfEf6b63d502bbC5df7Fbe
assetId : 2
debtAmount : 105912.840607
collateralValue : 144444.444444
isOverCollateralized : true
✓ Transaction submitted successfully. Hash: 0x8872a9fa770a33484fcd00f1df210f044b26c47a1f6609ffb277654aa999777d
✓ Transaction submitted successfully. Hash: 0x654518f69827f4a1f42dbf12a6b9ccd6994661aa8ea2dfdc825aeea46d7d34af
✓ Transaction submitted successfully. Hash: 0x7b3b1df7a4dc691728d0e789e0ed347aa322fda4acc12a1f5cd1a393ff28d0e0
✓ Transaction submitted successfully. Hash: 0x7b2e097b4502430c5eab1b4bc13c8fb85d19a8debe2ebb8e87819fac3c20293d
liquidator2 balance before mint : 0
amount minted to liquidator : 105912840759
user6 DebtAmount : 105912.840759
user6 UAED balance : 96296.296296
user6 ETH balance : 89.99634328
liquidator2 UAED balance : 105912840759
liquidator2 ETH balance : 99.99603184
owner2 UAED balance : 8595.726919
owner2 ETH balance : 100
✓ Transaction submitted successfully. Hash: 0x9efa8b0afb57ced374b8875c67f098b403ff337865a59acf28da1dfac3f034af
---------userLiquidated event -----------
user : 0x9839A1D3625B48e4c8EfEf6b63d502bbC5df7Fbe
--------------------
assetId : 2
--------------------
debtAmount : 105912.840912
--------------------
timeStamp : 1893412879
--------------------
user6 UAED balance : 96296.296296
user6 ETH balance : 92.54067398032322
liquidator2 UAED balance : 105912734846.15909
liquidator2 ETH balance : 107.44918307967679
liquidator2 balance change -7.453151239676785
liquidator2 gas usage method1 -3.726575619838393e-10
liquidator gas used method2 : 125903
owner2 UAED balance : 18212.271535
owner2 ETH balance : 100
√ step26: phase 7 : user6 is underCollateralized so is liquidated (3671ms)
---------------time manipulation---------------
before : 2029-12-31 12:01:19
after : 2030-12-31 12:01:21
-----------------------------------------------
-------balanceSnapShot-------
UAED totalSupply : 233089245351.9
owner2 UAED balance : 18212.271535
pool :
UAED : 877037.037038
ETH : 15
WETH : 0
-----------------------------
✓ Transaction submitted successfully. Hash: 0xbeed5b8bd8e1259742eb619f43352a866f0213aa835b3b7debb9100a040bbd43
--------price snapshot---------
ETH/USD : 1100
UAED/USD : 0.3
WETH/USD : 1100
✓ Transaction submitted successfully. Hash: 0x930540a9fa1e6280d3c9f048579fc9ca6dba472599ff1d1883d726ed2f99f62c
--------debt State SnapShot--------
user : 0x1f3b649FE21485CB9232487EEbaC096b57aF8E9c
assetId : 2
debtAmount : 110721.107883
collateralValue : 135802.469135
isOverCollateralized : true
✓ Transaction submitted successfully. Hash: 0x168dee81226439f06a41810a1fb8abce74b42c5a24f8c92110cf29e5d332cafc
✓ Transaction submitted successfully. Hash: 0xf23105de70bb0ff9085625c854f590e5a079f1bd345062325d78e4c67572ae8e
✓ Transaction submitted successfully. Hash: 0xbdb111c50b809aa020f8549d5751986216afca5dda3af24a449a1d24d86f5ef2
✓ Transaction submitted successfully. Hash: 0xd61c4b4096f81a0c9e2a382fdc1a2b7e58981c8d2a03c89566cceb6ce1792f5f
✓ Transaction submitted successfully. Hash: 0xa04f15e0e364f95e1ffc7b3b15aa67ae847eba0f88d319eefc69f78005ab6a8e
amount minted to liquidator : 4808373190
user debtAmount
collateral value in AED : 135802.469135
debt amount : 110721.108188
current collateral percentage (debtAmount/collateralValue) : 81.53099784800905 %
user7 UAED balance : 96296.296296
user7 ETH balance : 89.99634328
liquidator2 UAED balance : 110721108036.15909
liquidator2 ETH balance : 107.44918307967679
owner2 UAED balance : 18212.271535
owner2 ETH balance : 100
✓ Transaction submitted successfully. Hash: 0x77793b8a68dad4624857b10f7a50098f9d201f554f92bc13361ee0067eee6a74
---------userLiquidated event -----------
user : 0x1f3b649FE21485CB9232487EEbaC096b57aF8E9c
--------------------
assetId : 2
--------------------
debtAmount : 110721.108341
--------------------
timeStamp : 1924948884
--------------------
user7 UAED balance : 96296.296296
user7 ETH balance : 91.75791669456133
liquidator2 UAED balance : 110720997315.05075
liquidator2 ETH balance : 115.68539160511547
owner2 UAED balance : 32637.08358
owner2 ETH balance : 100
owner2 WETH balance : 0
√ step27: phase 8 : user7 is underCollateralized but isn't liquidated till the collateral value becomes less than debt! (4040ms)
test requests
✓ Transaction submitted successfully. Hash: 0xcbf4f5a3df2a00eebb1c6ee15007a6301fe9854d2a81fdbb734ce6db06b24a17
-------balanceSnapShot-------
UAED totalSupply : 237897618541.9
owner2 UAED balance : 32637.08358
pool :
UAED : 973333.333334
ETH : 5
WETH : 0
-----------------------------
collateralFactor: 73
request: 0xe940a2d06a20dd3e7e3b56996ad6d73051a19d69ce22c573de5297f28bffbbe1
assetId: 2
requestedCollateralFactor: 80
timeStamp: 1924948885
---------------time manipulation---------------
before : 2030-12-31 12:01:25
after : 2031-01-15 12:01:26
-----------------------------------------------
✖ Transaction submission failed with error -32000: 'VM Exception while processing transaction: revert wait more'
---------------time manipulation---------------
before : 2031-01-15 12:01:26
after : 2031-01-30 12:01:26
-----------------------------------------------
✖ Transaction submission failed with error -32000: 'VM Exception while processing transaction: revert onlyOwner'
✓ Transaction submitted successfully. Hash: 0xa58f6f36a5eac2946b2bc0400532bf8c3f08aa77c90e7fc69b110a989153c7f4
request: 0xe940a2d06a20dd3e7e3b56996ad6d73051a19d69ce22c573de5297f28bffbbe1
assetId: 2
newCollateralFactor: 80
√ step28: change ETH CollateralFactor to 80% (1423ms)
---------------time manipulation---------------
before : 2031-01-30 12:01:27
after : 2033-01-29 12:01:28
-----------------------------------------------
-------balanceSnapShot-------
UAED totalSupply : 237897618541.9
owner2 UAED balance : 32637.08358
pool :
UAED : 973333.333334
ETH : 5
WETH : 0
-----------------------------
✓ Transaction submitted successfully. Hash: 0x3cb748370c354984f1a28f4b15a16e4f1be10c38de661d3f434ddab70dad56cb
--------debt State SnapShot--------
user : 0x48D7FCBBFeE50F4536139F3F7D04D3dF0F62Ef5C
assetId : 2
debtAmount : 39030.881705
collateralValue : 67901.234567
isOverCollateralized : false
user2 UAED balance : 12325269940.236221
user2 ETH balance : 94.98840048
✖ Transaction submission failed with error -32000: 'VM Exception while processing transaction: revert uninsolvent user'
✓ Transaction submitted successfully. Hash: 0x4a9635efcf5da0056ff9d4bf6b8b703c0bd7e93864997a918274998eeb3b1a97
✓ Transaction submitted successfully. Hash: 0x73cd6b01a6410b98b4ca677644151dda77d1359bbdfc0a4666b953d19bed34b1
✓ Transaction submitted successfully. Hash: 0x58e8884987c25d009ca196f013cf63a9563640d01a39765083a5152a0cb13504
✓ Transaction submitted successfully. Hash: 0xace0a934e64b8307ff6e124e6e2b06a921b7cd979e7771e2437619c68dcd63b8
26705611807 UAED minted to user2
✓ Transaction submitted successfully. Hash: 0xca4a3a40cede46cfc38dd02dcb40c76a693f7bc13866e3b0d48ef9ce3ab1286e
---------debtPaid event -----------
user : 0x48D7FCBBFeE50F4536139F3F7D04D3dF0F62Ef5C
--------------------
assetId : 2
--------------------
debtAmount : 39030881790
--------------------
timeStamp : 1990612890
--------------------
user2 UAED balance : 39030842716.35443
user2 ETH balance : 99.98654853999999
owner2 UAED balance : 45001.298704
√ step29: user2 pays his debt after another 2 year (3687ms)
✓ Transaction submitted successfully. Hash: 0x7227476d21dc629bb46e659bbdae74f5ba140957bf144c47a78643ecf7223ff3
---collateralPauseToggled---
assetId : 11
-------balanceSnapShot-------
UAED totalSupply : 264603230348.9
owner2 UAED balance : 45001.298704
pool :
UAED : 1000000
ETH : 0
WETH : 0
-----------------------------
✓ Transaction submitted successfully. Hash: 0x3c6cb96e58a93a355b58e58c8004d33858eeca7a66a55f3a0e0333d0c581167c
✖ Transaction submission failed with error -32000: 'VM Exception while processing transaction: revert pausedAsset'
✓ Transaction submitted successfully. Hash: 0x84943417596d57f4dc59d6ca288194f488c7c47fb7316e12e35fb88109a14b34
---collateralPauseToggled---
assetId : 11
✓ Transaction submitted successfully. Hash: 0x47120a32b0ebaf62a39a476e03b1d30529552aae5cf491d18834d43189e783dd
√ step30: toggleWETHcollateralPause and check (1935ms)
✓ Transaction submitted successfully. Hash: 0x7b05f61d7c7a4791175f14749432e5eda66f45324ea1af136affa53794b91b54
-------balanceSnapShot-------
UAED totalSupply : 264603230348.9
owner2 UAED balance : 45001.298704
pool :
UAED : 990493.827161
ETH : 0
WETH : 1
-----------------------------
---collateralPauseToggled---
assetId : 2
✖ Transaction submission failed with error -32000: 'VM Exception while processing transaction: revert pausedAsset'
✓ Transaction submitted successfully. Hash: 0xcdd6e396066a53efc994a0f4e90d6b15f13033d846f2403e3474cf2399d60b07
---collateralPauseToggled---
assetId : 2
✖ Transaction submission failed with error -32000: 'VM Exception while processing transaction: revert wrong percentage'
✓ Transaction submitted successfully. Hash: 0xfddc1ccc4608c48aa196762fd5066c4ad1c779ccde7f62d60d70969e6c604967
√ step31: toggleETHcollateralPause and check (2191ms)
✓ Transaction submitted successfully. Hash: 0x72fdb04f9f31d09f21d456a65f6990dd821e38e4a373cca93407b7ed545cbdb0
-------balanceSnapShot-------
UAED totalSupply : 264603230348.9
owner2 UAED balance : 45001.298704
pool :
UAED : 895432.098766
ETH : 10
WETH : 1
-----------------------------
collateralFactor: 90
request: 0xa30561a72d0859a1a6a428490acb9d9abc1171fc8eb48ff55f6f0127d4faad6c
assetId: 11
requestedCollateralFactor: 75
timeStamp: 1990612898
---------------time manipulation---------------
before : 2033-01-29 12:01:38
after : 2033-02-13 12:01:38
-----------------------------------------------
✖ Transaction submission failed with error -32000: 'VM Exception while processing transaction: revert wait more'
✓ Transaction submitted successfully. Hash: 0x43f97c677393f2f7adf2b9bd73d82cb6fe0d8dafe5aff26f9763d89eac60ce70
request canceled: 0xa30561a72d0859a1a6a428490acb9d9abc1171fc8eb48ff55f6f0127d4faad6c
---------------time manipulation---------------
before : 2033-02-13 12:01:38
after : 2033-02-28 12:01:39
-----------------------------------------------
✖ Transaction submission failed with error -32000: 'VM Exception while processing transaction: revert onlyOwner'
✖ Transaction submission failed with error -32000: 'VM Exception while processing transaction: revert Request has expired'
√ step32: change WETH CollateralFactor to 75% and cancel the request (1944ms)
✓ Transaction submitted successfully. Hash: 0xaa7379427526cbc205236458c7497788c66033c6ce317799d719176191eeece3
-------balanceSnapShot-------
UAED totalSupply : 264603230348.9
owner2 UAED balance : 45001.298704
pool :
UAED : 895432.098766
ETH : 10
WETH : 1
-----------------------------
---------------time manipulation---------------
before : 2033-02-28 12:01:40
after : 2033-04-04 12:01:42
-----------------------------------------------
✖ Transaction submission failed with error -32000: 'VM Exception while processing transaction: revert onlyOwner'
✖ Transaction submission failed with error -32000: 'VM Exception while processing transaction: revert Request has expired'
√ step33: check expired requests (1306ms)
-------balanceSnapShot-------
UAED totalSupply : 264603230348.9
owner2 UAED balance : 45001.298704
pool :
UAED : 895432.098766
ETH : 10
WETH : 1
-----------------------------
test flashLoan and attack protocolPool
-------balanceSnapShot-------
UAED totalSupply : 264603230348.9
owner2 UAED balance : 45001.298704
pool :
UAED : 895432.098766
ETH : 10
WETH : 1
-----------------------------
✓ Transaction submitted successfully. Hash: 0xd0e4659c85fed42d9f8749a70d238feba9a29f46aca4fd94e7009de15a6c0d33
✓ Transaction submitted successfully. Hash: 0xc308a3cb045694183b4508a10ba07ad79cd4226d7fa043bdc086842902ed662a
✓ Transaction submitted successfully. Hash: 0x15f12c8835e79e62a69972be6ec90fe5f421f1268a9bda24c5478e8fee0a2bef
✓ Transaction submitted successfully. Hash: 0x33c2d0afafff7b52bb7eab2f199bf2d685ab8f43d71cceeb444aa9f361b32f4c
✖ Transaction submission failed with error -32000: 'VM Exception while processing transaction: revert ETHflashLoanPaused'
✓ Transaction submitted successfully. Hash: 0x3715ab201cb3dd4a291710289776c830a16a648cc2350cb71726a16ed926cf90
✓ Transaction submitted successfully. Hash: 0x955dd9fdb49593f9ab0615337031b99fd40c4fe8b9db442532e7ce6d965cf7d6
user : 0xBdC1aC422E4CB7F4EB73cea39F6E824dBE727318
assetId : 2
amount : 4000000000000000000
-------------------------------
ethFlashLoanTester : 0xBdC1aC422E4CB7F4EB73cea39F6E824dBE727318
√ step34: test ETH flashLoan method1 (2563ms)
-------balanceSnapShot-------
UAED totalSupply : 264603230353.9
owner2 UAED balance : 45006.298704
pool :
UAED : 895432.098766
ETH : 10
WETH : 1
-----------------------------
✓ Transaction submitted successfully. Hash: 0x8eb8812b4d6e04cfb76f11f439192a63b79b0e3c8bf31a1d8c6f93f73d09d6a6
✓ Transaction submitted successfully. Hash: 0x50c4acbea990e085e44a1686cf5ffa114ba189e824045cb3d0d81881c08ca760
✓ Transaction submitted successfully. Hash: 0x954458f871724a5fd206f0bc9ddeb2bf2d8c87518fe745024eab9c85709adbde
✓ Transaction submitted successfully. Hash: 0x6bb3d20a3aca86d469a3728f4c1da0e2de1a081f2740abccb6b3048536581fb4
✖ Transaction submission failed with error -32000: 'VM Exception while processing transaction: revert ReentrancyGuard'
√ step35: test ReentrancyGuard with ETH flashLoan method2 (1548ms)
-------balanceSnapShot-------
UAED totalSupply : 264603230358.9
owner2 UAED balance : 45006.298704
pool :
UAED : 895432.098766
ETH : 10
WETH : 1
-----------------------------
✓ Transaction submitted successfully. Hash: 0x59cc3e422f9fc142bf4504dbea9556057fd74c741c1220ced35981e85e0a0f6b
✖ Transaction submission failed with error -32000: 'VM Exception while processing transaction: revert ERCflashLoanPaused'
✓ Transaction submitted successfully. Hash: 0x4816ccc62c14acb3ef96d67e5179b7ea56e7589f772b9948997367f74d8c27c3
✖ Transaction submission failed with error -32000: 'VM Exception while processing transaction: revert ERC20: transfer amount exceeds balance'
✓ Transaction submitted successfully. Hash: 0x7b8ad4174976303f41fca766132401e51ecd6fd038fbf700957a2a810860d214
✓ Transaction submitted successfully. Hash: 0xae197e238f76bd90ecbb3cf17fd2235dddb49280104a6218498112351b768d39
✓ Transaction submitted successfully. Hash: 0x6aa4ff9e45bff17f75c2a1f274d2fa68900c33a4929c326e646a32d3cbf90a66
✓ Transaction submitted successfully. Hash: 0x1db2bb6db4446775ef3fb4b3e46847d254e63aaeaa877326f10c3e83f99e1505
-------flashLoanExecuted-------
user : 0x9C046326F63912335F137aE98F802c91e900Ef12
assetId : 11
amount : 1
-------------------------------
wethFlashLoanTester : 0x9C046326F63912335F137aE98F802c91e900Ef12
√ step36: test WETH flashLoan method1 (2744ms)
-------balanceSnapShot-------
UAED totalSupply : 264603230363.9
owner2 UAED balance : 45011.298704
pool :
UAED : 895432.098766
ETH : 10
WETH : 1
-----------------------------
✓ Transaction submitted successfully. Hash: 0xade3b0dacda2aea43b3c0340f89d07a0f93b90ca250ba57e2080a8efa2fed9e3
✖ Transaction submission failed with error -32000: 'VM Exception while processing transaction: revert ERC20: transfer amount exceeds balance'
✓ Transaction submitted successfully. Hash: 0xada6f9d6605b1dd02a18bfcfd7ece56368792d4b982fb72dc9cbaf571671b95d
✓ Transaction submitted successfully. Hash: 0x863a6c3ce0d31787fbbe8ef000b8263a9b0320d982ad6c510c605187c1d31a4c
✓ Transaction submitted successfully. Hash: 0xd83c0664fc5c0fdbcf7df4db033751dc33a869486266cb229540d9168cec9d77
✖ Transaction submission failed with error -32000: 'VM Exception while processing transaction: revert ERC20: transfer amount exceeds balance'
✓ Transaction submitted successfully. Hash: 0xe04b51171d9fa44673be6195b3a275aae5bc28efb1d390415f07175f4b175079
✓ Transaction submitted successfully. Hash: 0xf0ca05892189481e9ee6727d5e373996428e1019191fa718a5aa3085bb79d0f6
✓ Transaction submitted successfully. Hash: 0xb11e32d7fcb7b608cde11223656420853b9a77b7ed75525e01e107cc26007da4
✓ Transaction submitted successfully. Hash: 0xbb94c6f404a4b40e5240f1963267fe5254951474a4204cc0c842c3004512cfa6
-------flashLoanExecuted-------
user : 0xF0dF3c60f48c43Ea835BbCc7eB8b8A2eB4589ff2
assetId : 11
amount : 0.5
-------------------------------
wethFlashLoanTester : 0xF0dF3c60f48c43Ea835BbCc7eB8b8A2eB4589ff2
√ step37: test WETH flashLoan method2 (5360ms)
-------balanceSnapShot-------
UAED totalSupply : 264603230373.9
owner2 UAED balance : 45021.298704
pool :
UAED : 895432.098766
ETH : 10
WETH : 1
-----------------------------
✓ Transaction submitted successfully. Hash: 0x96cb4ab374fd35d938dc8381e29f66434c537dd234d50663fbfee3ece323ea41
✖ Transaction submission failed with error -32000: 'VM Exception while processing transaction: revert ERC20: transfer amount exceeds balance'
✓ Transaction submitted successfully. Hash: 0xdeec35747b9b287f29665180af1648ef428d0427f2d66af518ff98eeed83555e
✓ Transaction submitted successfully. Hash: 0x481df1167cc669e936a2b4a0df79ae43068e3cea4d2c782e7145b6c8d7af1fb9
✓ Transaction submitted successfully. Hash: 0x17aaec1fa98ec8bcdac61f84533bdca870baab6334ba638f3c19f3719625ac4a
✓ Transaction submitted successfully. Hash: 0xa0e948b44bd3d12a2bf2ee8fac7c22abc7bb548a9e2ef797cd96ae0f30176c4b
-------flashLoanExecuted-------
user : 0xEa0E9225650F145DB548a1e59633fc0C23C48Faf
assetId : 0
amount : 100000
-------------------------------
uaedFlashLoanTester : 0xEa0E9225650F145DB548a1e59633fc0C23C48Faf
√ step38: test UAED flashLoan method1 (2774ms)
-------balanceSnapShot-------
UAED totalSupply : 264603230378.9
owner2 UAED balance : 45026.298704
pool :
UAED : 895432.098766
ETH : 10
WETH : 1
-----------------------------
✓ Transaction submitted successfully. Hash: 0xaad44241ec9e9de7edd341f06fa766b605b87a8fea75321a9465edc625eb829d
✖ Transaction submission failed with error -32000: 'VM Exception while processing transaction: revert ERC20: transfer amount exceeds balance'
✓ Transaction submitted successfully. Hash: 0xd76943127725a980e0bc55b7d616023694f468954c55e5da24f80acada973852
✓ Transaction submitted successfully. Hash: 0x3a26efb0ce9c44578df3ae4614fc2022c3a80936c150f4ad74424071cf5a374d
✓ Transaction submitted successfully. Hash: 0x11cb0ea72bf975d913ecf0399837a832599aca9e5c6c25d55d70de50ba44b82a
✖ Transaction submission failed with error -32000: 'VM Exception while processing transaction: revert ERC20: transfer amount exceeds balance'
✓ Transaction submitted successfully. Hash: 0xee0d7e7d26c32a7e509db2d746bab24b6dc05d0136ca01f8668a60ed218b1a9f
✓ Transaction submitted successfully. Hash: 0xeb6a56e9e6636288c260a430436ce2fdabf70c2fbf94cfcb617742bc6ecdf181
✓ Transaction submitted successfully. Hash: 0xff1ccfa6ebeb279c1a6647273f03641066352df3b0cb111001e7948c9849f2e0
✓ Transaction submitted successfully. Hash: 0x70fdfce723f809c27493d5773be77692daa091cfe3c53d1bd85ee980d6550d12
-------flashLoanExecuted-------
user : 0xC2fA0d3bB0C01E7dEBd5485390CD091E7b304b79
assetId : 0
amount : 200000
-------------------------------
uaedFlashLoanTester : 0xC2fA0d3bB0C01E7dEBd5485390CD091E7b304b79
√ step39: test UAED flashLoan method2 (6478ms)
-------balanceSnapShot-------
UAED totalSupply : 264603230388.9
owner2 UAED balance : 45036.298704
pool :
UAED : 895432.098766
ETH : 10
WETH : 1
-----------------------------
39 passing (2m)