Commit d19cf639 authored by Kegan's avatar Kegan
Browse files

Updated documentation

parent 2da48426
......@@ -4,6 +4,10 @@ title: Ropsten
parent: Deployed Contracts
---
[Under Development](#){: .label .label-purple }
# Ropsten Contracts [Under Development](#){: .label .label-purple }
Ropsten test network contract links and details
\ No newline at end of file
Defund v3: `0x7F5BDee013Dfb9F04E2B8cDBBa98c0187dcF0c7e` [Etherscan](https://ropsten.etherscan.io/address/0x7F5BDee013Dfb9F04E2B8cDBBa98c0187dcF0c7e)
Defund Share Token: `0x104c5EdeF978FC09173BE876DDCF4D85B5c2E04A` [Etherscan](https://ropsten.etherscan.io/address/0x104c5EdeF978FC09173BE876DDCF4D85B5c2E04A)
Defund Oracle: `0x7eac34ec65ba6869c63a852106982d6a6b9b4caa` [Etherscan](https://ropsten.etherscan.io/address/0x7eac34ec65ba6869c63a852106982d6a6b9b4caa)
---
layout: page
title: Oracle
parent: Smart Contracts
---
# DeFund Oracle Contract [Under Development](#){: .label .label-purple }
This contract was created to allow 3rd party applications to easily determine the market value of the DeFund Share Token. In order to allow easy integration with many platforms, the contract was designed with two methods identical to those found in Chainlink's aggregator interface.
`latestAnswer` will return the latest valuation, in WEI, of 1 DFT. This value is derrived from the underlying assets held in DeFund, and the valuation of each asset returned by Chainlinks Aggregator contracts. *In simpler terms*, it uses Chainlink to determine the market rate of assets 1 DFT represents.
---
You can interact with the defund oracle using the following interface.
```solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
interface IDefundOracle {
function GetToken() external view returns(address);
function GetFund() external view returns(address);
function latestAnswer() external view returns(int256);
function latestTimestamp() public view returns (uint256);
function oldestTimestamp() public view returns(uint256);
}
```
......@@ -131,4 +131,21 @@ The DeFund smart contract controls:
This process mints DFT into the depositor's account.
Example: Deposit() (or simply send a transaction to the contract address)
---
\ No newline at end of file
---
A basic interface for DeFund exists. This is used by the Defund Oracle contract.
```solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
interface IDefund {
function GetTotalValue() external view returns (uint256);
function GetHoldings(address token_contract) external view returns(uint256);
function GetHeldValue(address token_contract) external view returns(uint256);
function GetAccountValue(address owner) external view returns(uint256);
function GetAggregator(address token_contract) external view returns(address);
function GetSourcesCount() external view returns(uint);
function GetSource(uint index) external view returns(address);
}
```
\ No newline at end of file
......@@ -39,4 +39,27 @@ Here is a complete list of all additional functions:
---
You can view the source for DFT on [Gitlab](https://gitlab.desolationredux.com/kegan/defund/-/blob/master/Contract/DefundToken.sol)
\ No newline at end of file
You can view the source for DFT on [Gitlab](https://gitlab.desolationredux.com/kegan/defund/-/blob/master/Contract/DefundToken.sol)
---
An interface for DFT exists. It is used by both DeFund and the DeFund Oracle contracts.
```solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
interface IDefundToken {
function burn(address account, uint256 amount) external;
function burnFrom(address account, uint256 amount) external;
function mintTo(address account, uint256 amount) external;
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
```
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment