- As a client I want to enter the Pairwyse website and be able to create an Agreement Tranches smart contract (AT) that would allow the user to deposit USDC tokens into Compound V2.
- As a client I want to specify the Deposits Deadline and Lock Time variables for AT contract.
- As a user I want to enter the deployed AT contract by providing USDC to it.
- As anyone I want to trigger depositing my USDC to Compound V2 from AT contract after the Deposits Deadline has passed.
- As a user I want to withdraw my funds (body; without the interest) from AT contract after the Deposits Deadline + Lock Time has passed.
For commit with ID 95709a7f291ce61541bc78189e906ae73c2ffe53
- StringStack 0x2cD6BeBf36BC7eCf3B5303B033FCd0cce28653C9
- StringUtils 0xD816C20e28Cc704028c475108f4DC535e237EbD9
- Preprocessor address 0x43cF86ea1eC36C023d5d0E801dD8C459AC456947
- OpcodeHelpers 0x088890626B062e1E7De8f13d49c72bDCB93066b0
- ComparisonOpcodes 0x62Ab7De53EF4bFfAB0133dea58EF3C1d202D894e
- BranchingOpcodes 0xC0e037AC5F7181b3f28B939301860e74AFd4A265
- LogicalOpcodes 0xcd6037cDC0166E7735d6AB1819688050F186692c
- OtherOpcodes 0xDC246FA53Bc64B05ed639Cf90cD5640876F80D3A
- DSLContext 0x20FE732B7A4BCA0f637d459ee53f4B2Cf46583fF
- ByteUtils 0x1C407CDD4975532Bb5f3f614FB3b48478f597f49
- Parser 0x4827b97709B2E8cf1F53Da11f7Fb069CD18F739d
- Executor 0x69D4725cc55980416bA5AEd6EC565547D281c8F9
- Connect to Pritunl using the instuctions in the Confluence.
- Open your browser with MetaMask and navigate to https://dsl.qa.akiva.capital/
- Authorize the website with a MetaMask address (creator) that has enough GETH and make sure MetaMask is connected to the Goerli network.
- Prepare another MetaMask address (investor) with some GETH (about 0.2 GETH) and 100 Goerli USDC (or more)
Note: to receive GETH you may use one of the available GETH Faucets like https://goerlifaucet.com/
Note: to receive Goerli USDC you must use the USDC Faucet contract located at 0x75442Ac771a7243433e033F3F8EaB2631e22938f and call the drip
function.
-
Click on the
Agreement Interaction
button, and you will be redirected to AgreementCreation
tab. -
On this tab from the dropdown menu select the "MultiTranche" option and hit the
Create Agreement
button. After this, you will have many MetaMask prompts to send transactions (about 7-10 transactions). Make sure you confirm all of the transactions. -
After the MultiTranche contract is deployed copy and write down its address (you will see a MultiTranche address in the notification on the right of the screen).
-
Define a variable
DEPOSITS_DEADLINE
of type "number" with a timestamp in seconds of any time in the future. This variable controls the deadline to control.
Note: For demo purposes, the best option for the deadline would be about 3 minutes ahead of the current block timestamp. You may use the https://www.unixtimestamp.com/ website to find the timestamp of any given time. Make sure that your timestamp is in UTC
-
(optional) Define a
LOCK_TIME
variable. This variable controls how long the user cannot withdraw his/her USDC. Set this variable to any positive number (in seconds) to lock the withdrawal.
-
Connect to the website with the investor's address.
-
Navigate to MultiTranche contract on Goerli, call WUSDC() function to obtain the WUSDC address, and write it down. You may check this contract as an example.
-
Add the WUSDC token to the investor's MetaMask wallet by its address (from the previous step). Your balance should be 0 WUSDC.
-
Open a Goerli USDC smart contract in Goerli block explorer. Use the
approve
function to approve 100 USDC (100000000 – with decimals) to be spent by MultiTranche contract address. -
Note your USDC balance. It should be greater than 100 USDC. Now go back to the Pairwyse DSL website navigate to the
Execution
tab, select1
in theID
dropdown (this is record #1), and hit theExecute
button. After the transaction is confirmed, your WUSDC balance (you may check in MetaMask) should be 100 WUSDC, while your USDC balance should be decreased by 100 USDC.
Note: if the transaction fails, make sure that the deadline that you have set is still some time in the future.
-
After the deadline is in the past – execute record #2. To do that, you should use the same
Execution
tab, select2
from theID
dropdown, and hit theExecute
button. -
If you have set a
LOCK_TIME
variable to a non-zero value, wait until the lock time has passed. -
Open a Goerli WUSDC smart contract in Goerli block explorer by searching the contract by its address. Use the
approve
function to approve 100 WUSDC to be spent by MultiTranche contract address. -
Note your WUSDC and USDC balances in MetaMask. After record #3 is executed these token balances will change. On the
Execution
screen execute record #3. After the transaction is confirmed, the investor's USDC balance should be increased by 100 USDC. The WUSDC balance should become 0 WUSDC. -
You have received all your USDC back. The Demo is completed!