Skip to content

Commit

Permalink
wow
Browse files Browse the repository at this point in the history
  • Loading branch information
proxima424 committed Dec 26, 2022
1 parent 21be0b9 commit 86e7e89
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 6 deletions.
2 changes: 1 addition & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ src = 'src'
out = 'out'
libs = ['lib']

# See more config options https://github.com/foundry-rs/foundry/tree/master/config
# See more config options https://github.com/foundry-rs/foundry/tree/master/config
24 changes: 21 additions & 3 deletions src/DNSShortPosition.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,36 @@
pragma solidity ^0.8.15;


contract DNSShortPosition{
contract DNSShortPosition {

/* ERRORS */
error INVALID_USER(address entrant);

/// @notice Address of the controlling factory contract
address immutable factory;

///@notice Contains relevant data related to a position
struct CollateralData {
address token;
uint256 amount;
uint256 tokenId;
uint256 startPrice;
}



constructor(address _factory){
factory = _factory;
}

/// @notice Instead of a modifier, we include this line at the start of every function
/// @notice This is to decrease contract bytecode size (find out more why)
function onlyFactory() internal {
require(msg.sender==factory,"INVALID_USER");
if(msg.sender != factory){
revert INVALID_USER(msg.sender);
}
_;
}

struct Collateral

}
16 changes: 14 additions & 2 deletions src/DNSfactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ import {AggregatorV3Interface} from "./AggregatorV3Interface.sol";

interface DNSfactory is Ownable, DNSerc721 {
/////////////////////////// STORAGE ///////////////////////////////////
address immutable DNSerc20_Address;

// DNS minting ERC20 address
address public immutable DNSerc20_Address;
// Dummy contract manipulating ShortPosition
address public immutable DNS_ShortPosition;

// address => nonceCount
mapping(address => uint256) addressNonce;
Expand All @@ -34,6 +38,7 @@ interface DNSfactory is Ownable, DNSerc721 {
// erc20Address => Issupported
mapping(address => bool) isERC20Supported;

/// @notice Chainlink Price Feed
AggregatorV3Interface internal priceFeed;

struct CollateralData {
Expand Down Expand Up @@ -190,8 +195,15 @@ interface DNSfactory is Ownable, DNSerc721 {
quantity = quantity * (10 ** 10) * _quantity;
}

function createShortPosition() internal returns(bool);
function createShortPosition() internal returns(bool){

}

function getShortPositionData() public returns(int256){

}


function mintERC20DNS(uint256 theTokenId) external returns (bool) {
require(!isMinted[theTokenId], "ALREADY_MINTED");
CollateralData memory userPosition = tokenIDToPosition[theTokenId];
Expand Down

0 comments on commit 86e7e89

Please sign in to comment.