Skip to content

Commit

Permalink
docs/: Remove legacy monitoring functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
pmerkleplant committed Feb 2, 2024
1 parent 669bd10 commit f309df4
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 126 deletions.
34 changes: 0 additions & 34 deletions docker/readWithAge.dockerfile

This file was deleted.

47 changes: 0 additions & 47 deletions docs/Monitoring.md

This file was deleted.

45 changes: 0 additions & 45 deletions script/Scribe.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -232,51 +232,6 @@ contract ScribeScript is Script {
vm.stopBroadcast();
}

// -- View Functions

/// @dev Prints instance's `self` current price and age.
///
/// Note that RPC_URL env variable must be set!
function readWithAge(address self) public {
string memory rpc = vm.envString("RPC_URL");
require(bytes(rpc).length != 0, "No RPC_URL env variable set");

vm.createSelectFork(rpc);

address[] memory authed = IAuth(self).authed();
require(authed.length != 0, "No address auth'ed");

vm.prank(authed[0]);
IToll(self).kiss(address(0xcafe));

vm.startPrank(address(0xcafe));
bool ok;
uint price;
uint age;
(ok, price, age) = IScribe(self).tryReadWithAge();
require(ok, "Read failed");

// Print price with decimal point.
// Note that `cast to-fixed-point [DECIMALS] [VALUE]` is used.
// @todo Remove ffi call once forge-std supports fixed-point
// formatting natively.
// See https://github.com/foundry-rs/foundry/issues/5106#issuecomment-1589721658.
assert(IScribe(self).decimals() == 18);
string memory priceOut;
{
string[] memory inputs = new string[](4);
inputs[0] = "cast";
inputs[1] = "to-fixed-point";
inputs[2] = vm.toString(uint(18));
inputs[3] = vm.toString(price);
priceOut = string(vm.ffi(inputs));
}

console2.log(
string.concat("price=", priceOut, ", age=", vm.toString(age))
);
}

// -- IAuth Functions --

/// @dev Grants auth to address `who`.
Expand Down

0 comments on commit f309df4

Please sign in to comment.