Place your order now for a similar assignment and have exceptional work written by our team of experts, At affordable rates
For This or a Similar Paper Click To Order Now
Individual Coursework
The individual course work consists of 3 parts
Smart contract for marketplaces in DAML (20 points)
Bitcoin Testnet Transaction (15 points)
Interacting with Uniswap (65 points)
Deliverables
Upload one PDF file that includes the following information:
Complete Python code (BTC transactions) and smart contract code (DAML and Solidity);
Screenshots of the transaction submitted on the BTC testnet;
Answers and explanations requested below.
Smart contract for marketplaces in DAML
In this exercise you have to build in a smart contract template in DAML that can be used for
decentralized marketplaces. To do this, you are asked to create a new contract template
called Itemtosell that the seller can use to advertise a certain item and transfer
ownership to a buyer . We also wish to add an insurer that can only view the information
about the trade (without being able to issue or modify the contract Itemtosell ).
Contract template
1. Start by creating a new project and .daml file.
2. Create a contract template called Itemtosell (3 points). In the contract you must
specify the following:
Seller
Owner
Insurer
Type of item
Quantity
Price
Currency3. Then, define the roles of the parties. What type of party should the seller be? And the
insurer? (2 points)
4. Add a function ChangePrice to modify the price listed in the contract where the
controller is the “owner” of the item. (2 points)
5. Add a function Sell that modifies the owner of the item listed in the contract where
the controller is the “owner” of the item. (2 points)
Scenario testing
In the scenario testing part, using the following structure
test = Script()
test = script do
— Add parties
— Create contract
— Transfer ownership
return()
you must:
1. Create three parties: “Party 1” (the seller), “Party 2” (the buyer), “Party 3” (the insurer). (3
points)
2. Let the seller “Party 1” issue a new contract where the seller “Party 1” wishes to sell 1
painting for 1000 GBP to “Party 2”. At this stage set the owner = the seller (2 points)
3. Let the owner (=seller) of the painting transfer the ownership to “Party 2” (the buyer).
(2 points)
4. Take a screenshot of the state of the ledger (by looking at the scenario results). (2
points)
5. Describe one example where the execution of the contract would fail automatically and
explain why this would happen. (2 points)
Bitcoin Testnet Transaction
Use the Python code developed in the lab practical session.1. Create 4 Bitcoin Testnet addresses. Add below the addresses and the corresponding
secrets, namely address1, address2, address3, address4. (2 points)
2. From a BTC testnet faucet (e.g., https://bitcoinfaucet.uo1.net) send >5000 Satoshis to
one of the addresses. (1 point)
3. Create a 1-input 3-outputs transactions transferring 50%, 30%, 15% of the amount
respectively into address2, address3, address4 respectively. (5 points)
4. Sign the transaction and submit it into the Bitcoin testnet via
https://live.blockcypher.com/btc/pushtx/ (5 points)
5. How much fees are transferred to the miner and how are they calculated? (2 points)
Interacting with Uniswap
Your submission should include answers to the following questions.
You are recommended to read through all the questions first before you start to attempt.
1. Create a token with the following configuration using LuckyTokenSkeleton.sol on
Remix:
name: LuckyCoin{your_initials}
symbol: LC{your_initials} (for simplification, we call it LC below)
decimals: 18 Note: please make sure to read carefully the in-line comments and
block comments in LuckyTokenSkeleton.sol which contain further, more detailed
instructions on how to complete the contract. Also, read through the entire script
to understand the structure of the code first before starting to attempt.
i. What is the contract code? (10 points)
2. Test the contract by deploying it on a Remix VM and interacting with the contract.
Include in your test at least the following steps:
mint 2 LC to some address X
[… some intermediary steps in between …]
use some other address Y to call transferFrom to transfer 0.48 LC from address
X to some 3rd address Z
i. Share a screenshot where you call balanceOf of address Z on Remix immediately
after the transferFrom step described above. (5 points)
3. Choose an EVM-testnet where Uniswap V3 and ChainLink are deployed. Tap enough
native coins (e.g. ETH for Goerli, MATIC for Polygon Mumbai) to be used to pay gas as
well some LINK .i. What is the test network that you choose?
ii. How did you obtain coins and tokens on this test network? (2 points)
4. Specify an account address that will be used to sign transactions on the chosen testnet
in this assignment (let’s call it address A below).
i. What’s the address? (1 point)
5. Deploy token LC onto the test network from address A.
i. What is the token smart contract address?
ii. What is the transaction hash?
iii. Verify and Publish your contract source code. Share the code URL, e.g.
https://mumbai.polygonscan.com/address/0x326c977e6…
60ed06fb#code (10 points)
6. Create a liquidity pool with LINK and LC with the following configuration (slight
numerical deviations enforced by the UI/UX can be tolerated). You can do so by directly
interacting with the web interface of Uniswap:
fee tier: 0.3%
Current price: 500 LC / LINK
Min price: 400 LC / LINK
Max price: 600 LC / LINK
Deposit amount: 0.5 LINK
i. What is the amount of LC that needs to be deposited?
ii. What is the pool URL?
iii. What is the pool smart contract address? (3 points)
7. Try to buy 0.1 LINK with LC without confirming the transaction.
i. What is the amount of LC expected to be paid?
ii. What is the maximum sent after slippage?
iii. What is the price impact? Note: in the rare case when Uniswap UI malfunctions
and you cannot locate the tokens in the swap interface, you can manually type
your tokens’ addresses in the URL as in https://app.uniswap.org/#/swap?
outputCurrency=0x4BF3027C28Ca9001c6EF9700571922f3c2A0E854&inputCurrenc
y=0x326C977E6efc84E512bB9C30f76E30c160eD06FB (3 points)
8. Buy 0.05 LINK with LC with slippage tolerance of 1.2%.
i. What does the app warn you with this slippage setting?ii. Briefly interpret the warning message.
iii. What is the amount of LC to be paid?
iv. What is the liquidity provider fee?
v. What is the price impact?
vi. What is the transaction hash?
vii. What is the current price of LINK denominated in LC after the transaction? (7
points)
9. Sell 0.05 LINK for LC with slippage tolerance of 0.02%.
i. What does the app warn you with this slippage setting?
ii. Briefly interpret the warning message.
iii. What is the amount of LC to be received?
iv. What is the liquidity provider fee?
v. What is the price impact?
vi. What is the transaction hash?
vii. What is the current price of LINK denominated in LC after the transaction? (7
points)
10. Collect all the fees.
i. How many fees are there?
ii. What is the transaction hash? (2 points)
11. Add more liquidity to the pool with 0.1 LINK .
i. What is the amount of LC to be added?
ii. What is the transaction hash? (2 points)
12. Remove 25% of the liquidity from the pool.
i. What is the respective amount of LC and ETH to be removed?
ii. What is the transaction hash?
iii. What is the current price of LINK denominated in LC after the transaction? (3
points)
13. Based on the experiment above and your own understanding of Uniswap mechanism
as well as AMM-based DEX in general, briefly generalize the relationships between spot
price, liquidity depth, slippage tolerance, exchange volume, price impact and liquidity
provider fee. (10 points)
Why Work with Us
Top Quality and Well-Researched Papers
We always make sure that writers follow all your instructions precisely. You can choose your academic level: high school, college/university or professional, and we will assign a writer who has a respective degree.
Professional and Experienced Academic Writers
We have a team of professional writers with experience in academic and business writing. Many are native speakers and able to perform any task for which you need help.
Free Unlimited Revisions
If you think we missed something, send your order for a free revision. You have 10 days to submit the order for review after you have received the final document. You can do this yourself after logging into your personal account or by contacting our support.
Prompt Delivery and 100% Money-Back-Guarantee
All papers are always delivered on time. In case we need more time to master your paper, we may contact you regarding the deadline extension. In case you cannot provide us with more time, a 100% refund is guaranteed.
Original & Confidential
We use several writing tools checks to ensure that all documents you receive are free from plagiarism. Our editors carefully review all quotations in the text. We also promise maximum confidentiality in all of our services.
24/7 Customer Support
Our support agents are available 24 hours a day 7 days a week and committed to providing you with the best customer experience. Get in touch whenever you need any assistance.
Try it now!
How it works?
Follow these simple steps to get your paper done
Place your order
Fill in the order form and provide all details of your assignment.
Proceed with the payment
Choose the payment system that suits you most.
Receive the final file
Once your paper is ready, we will email it to you.
Our Services
No need to work on your paper at night. Sleep tight, we will cover your back. We offer all kinds of writing services.
Essays
No matter what kind of academic paper you need and how urgent you need it, you are welcome to choose your academic level and the type of your paper at an affordable price. We take care of all your paper needs and give a 24/7 customer care support system.
Admissions
Admission Essays & Business Writing Help
An admission essay is an essay or other written statement by a candidate, often a potential student enrolling in a college, university, or graduate school. You can be rest assurred that through our service we will write the best admission essay for you.
Reviews
Editing Support
Our academic writers and editors make the necessary changes to your paper so that it is polished. We also format your document by correctly quoting the sources and creating reference lists in the formats APA, Harvard, MLA, Chicago / Turabian.
Reviews
Revision Support
If you think your paper could be improved, you can request a review. In this case, your paper will be checked by the writer or assigned to an editor. You can use this option as many times as you see fit. This is free because we want you to be completely satisfied with the service offered.