vnavascues / auction-platform Goto Github PK
View Code? Open in Web Editor NEWA DApp for auctioning deeds (backend)
License: Creative Commons Attribution Share Alike 4.0 International
A DApp for auctioning deeds (backend)
License: Creative Commons Attribution Share Alike 4.0 International
At the moment an auction can only be ended (i.e. endAuction()
) if the following criteria is met:
endAuction()
is the owner of the auction (checked by onlyAuctionOwner()
modifier).block.timestamp >= auction.blockDeadline
).It would be great to automatise the end of an auction (and more) with Chainlink, but still allow the auction owner to manually finish it.
ChainlinkClient
and Ownable
(for transferring the ownership of some methods to AuctionRepository).request()
:
onlyOwner
modifier.validateChainlinkCallback()
: given the chosen design pattern (AuctionRepository.sol
does not inherit from ChainlinkClient.sol
). AuctionRepository must be protected against malicious callers (e.g. check both sender and requestId).
onlyOwner
modifier.cancelRequest()
:
onlyOwner
modifier.withdrawLink()
: TBC
onlyOwner
modifier.initialize()
:
ChainlinkedContract
and store its reference within the contract.createAuction()
:
ChainlinkedContract.request()
with:
auction.blockDeadline - block.timestamp
as a delta unit
. Double check this.this.address
as a _callbackAddress
.endAuction()
as a _callbackFunctionSignature
.mapping(bytes32 => uint256) private requestIdAuctionId
).endAuction()
:
ChainlinkedContract
.ChainlinkedContract.validateChainlinkCallback()
.requestIdAuctionId
mapping entry.cancelAuction()
:
requestIdAuctionId
mapping entry.ChainlinkedContract.cancelRequest()
.cancelledRequestFulfill()
: TBC, transfer link back to the auction owner.updateOracleAddress()
updateJobId()
AuctionRepository.sol
inherit from ChainlinkClient
? (inheritance). Furthermore the design must be compatible with the AuctionRepository.sol
upgradeable capabilities (via OpenZeppelin upgradeable contracts).sleep
adapter "built-in" one or do I have to ask a node operator to list it? It seems not avaiable right now.Chainlink API Reference
Chainlink alarms
Sleep adapter
OZ Upgradeable Contracts
OZ Upgradeable Contracts + Chainlinked 1
OZ Upgradeable Contracts + Chainlinked 2
Below a list of known issues. Not all of them will be addressed due to the nature/status of the app (learning purposes):
AuctionRepository.sol
is a type of auction room that offers no protection against front-running attacks (being the displacement the most relevant here). No strategies like limits (e.g. gas, bid % variation), commit-reveal schema or submarine sends have been adopted.By preventing a bidder to bid twice in a row, a displacement front-running "attack" can be mitigated.
if (bidsLength == 0) {
require(msg.value > auction.startPrice, "Bid below starting price");
} else {
currentBid = auctionBids[_auctionId][bidsLength - 1];
require(msg.sender != currentBid.from, "Consecutive bids"); // Add this statement expression
require(msg.value > currentBid.price, "Bid below current bid");
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.