diff --git a/.gitmodules b/.gitmodules index 888d42d..64ae7f4 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,8 @@ [submodule "lib/forge-std"] path = lib/forge-std url = https://github.com/foundry-rs/forge-std + + +[submodule "lib/chainlink-brownie-contracts"] + path = lib/chainlink-brownie-contracts + url = https://github.com/smartcontractkit/chainlink-brownie-contracts diff --git a/foundry.toml b/foundry.toml index 25b918f..07d7b19 100644 --- a/foundry.toml +++ b/foundry.toml @@ -2,5 +2,8 @@ src = "src" out = "out" libs = ["lib"] +remappings = [ + '@chainlink/contracts/=lib/chainlink-brownie-contracts/contracts', +] # See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options diff --git a/lib/chainlink-brownie-contracts b/lib/chainlink-brownie-contracts new file mode 160000 index 0000000..f06ed4c --- /dev/null +++ b/lib/chainlink-brownie-contracts @@ -0,0 +1 @@ +Subproject commit f06ed4c7e43de0359e0e337ce56e55cab90b0178 diff --git a/script/Counter.s.sol b/script/Counter.s.sol deleted file mode 100644 index df9ee8b..0000000 --- a/script/Counter.s.sol +++ /dev/null @@ -1,12 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.13; - -import {Script, console} from "forge-std/Script.sol"; - -contract CounterScript is Script { - function setUp() public {} - - function run() public { - vm.broadcast(); - } -} diff --git a/src/Counter.sol b/src/Counter.sol deleted file mode 100644 index aded799..0000000 --- a/src/Counter.sol +++ /dev/null @@ -1,14 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.13; - -contract Counter { - uint256 public number; - - function setNumber(uint256 newNumber) public { - number = newNumber; - } - - function increment() public { - number++; - } -} diff --git a/src/dTSLA.sol b/src/dTSLA.sol new file mode 100644 index 0000000..60adf9a --- /dev/null +++ b/src/dTSLA.sol @@ -0,0 +1,33 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.25; + +import {ConfirmedOwner} from "@chainlink/contracts/src/v0.8/shared/access/ConfirmedOwner.sol"; + +/** + * @title dTSLA + * @author Pandit Dhamdhere + * @notice + */ + +contract dTSLA { + /// Send an HTTP request to: + // 1. How much TSLA is bought + // 2. If enough TSLA is in the alpaca account, + // mint dTSLA + + // Transaction function + function sendMintRequest(uint256 amount) external onlyOwner {} + + function _mintFulFillRequest() internal {} + + /// @notice USER sends a request to sell TSLA for USDC or (Redemption token ) + // This , have the chainlink function call our alpaca(bank) + /// and do the following: + // 1. Sell TSLA on the brokerage + // 2. Buy USDC on the brokerage + // 3. Send USDC to this contract for the user to withdraw + + function sendRedeemRequest() external {} + + function _redeemFulFillRequest() internal {} +} diff --git a/test/Counter.t.sol b/test/Counter.t.sol deleted file mode 100644 index 54b724f..0000000 --- a/test/Counter.t.sol +++ /dev/null @@ -1,24 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.13; - -import {Test, console} from "forge-std/Test.sol"; -import {Counter} from "../src/Counter.sol"; - -contract CounterTest is Test { - Counter public counter; - - function setUp() public { - counter = new Counter(); - counter.setNumber(0); - } - - function test_Increment() public { - counter.increment(); - assertEq(counter.number(), 1); - } - - function testFuzz_SetNumber(uint256 x) public { - counter.setNumber(x); - assertEq(counter.number(), x); - } -}