Transactions
Token Transfers
Tokens
Internal Transactions
Coin Balance History
Logs
Code
Read Contract
Write Contract
Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
This contract has been partially verified via Sourcify.
View contract in Sourcify repository
- Contract name:
- SaiVox
- Optimization enabled
- true
- Compiler version
- v0.4.19+commit.c4cbbb05
- Optimization runs
- 200
- Verified at
- 2026-04-22T16:11:32.772377Z
Constructor Arguments
0000000000000000000000000000000000000000033b2e3c9fd0803ce8000000
Arg [0] (uint256) : 1000000000000000000000000000
SaiVox.sol
// hevm: flattened sources of src/vox.sol
pragma solidity ^0.4.18;
////// lib/ds-guard/lib/ds-auth/src/auth.sol
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
/* pragma solidity ^0.4.13; */
contract DSAuthority {
function canCall(
address src, address dst, bytes4 sig
) public view returns (bool);
}
contract DSAuthEvents {
event LogSetAuthority (address indexed authority);
event LogSetOwner (address indexed owner);
}
contract DSAuth is DSAuthEvents {
DSAuthority public authority;
address public owner;
function DSAuth() public {
owner = msg.sender;
LogSetOwner(msg.sender);
}
function setOwner(address owner_)
public
auth
{
owner = owner_;
LogSetOwner(owner);
}
function setAuthority(DSAuthority authority_)
public
auth
{
authority = authority_;
LogSetAuthority(authority);
}
modifier auth {
require(isAuthorized(msg.sender, msg.sig));
_;
}
function isAuthorized(address src, bytes4 sig) internal view returns (bool) {
if (src == address(this)) {
return true;
} else if (src == owner) {
return true;
} else if (authority == DSAuthority(0)) {
return false;
} else {
return authority.canCall(src, this, sig);
}
}
}
////// lib/ds-spell/lib/ds-note/src/note.sol
/// note.sol -- the `note' modifier, for logging calls as events
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
/* pragma solidity ^0.4.13; */
contract DSNote {
event LogNote(
bytes4 indexed sig,
address indexed guy,
bytes32 indexed foo,
bytes32 indexed bar,
uint wad,
bytes fax
) anonymous;
modifier note {
bytes32 foo;
bytes32 bar;
assembly {
foo := calldataload(4)
bar := calldataload(36)
}
LogNote(msg.sig, msg.sender, foo, bar, msg.value, msg.data);
_;
}
}
////// lib/ds-thing/lib/ds-math/src/math.sol
/// math.sol -- mixin for inline numerical wizardry
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
/* pragma solidity ^0.4.13; */
contract DSMath {
function add(uint x, uint y) internal pure returns (uint z) {
require((z = x + y) >= x);
}
function sub(uint x, uint y) internal pure returns (uint z) {
require((z = x - y) <= x);
}
function mul(uint x, uint y) internal pure returns (uint z) {
require(y == 0 || (z = x * y) / y == x);
}
function min(uint x, uint y) internal pure returns (uint z) {
return x <= y ? x : y;
}
function max(uint x, uint y) internal pure returns (uint z) {
return x >= y ? x : y;
}
function imin(int x, int y) internal pure returns (int z) {
return x <= y ? x : y;
}
function imax(int x, int y) internal pure returns (int z) {
return x >= y ? x : y;
}
uint constant WAD = 10 ** 18;
uint constant RAY = 10 ** 27;
function wmul(uint x, uint y) internal pure returns (uint z) {
z = add(mul(x, y), WAD / 2) / WAD;
}
function rmul(uint x, uint y) internal pure returns (uint z) {
z = add(mul(x, y), RAY / 2) / RAY;
}
function wdiv(uint x, uint y) internal pure returns (uint z) {
z = add(mul(x, WAD), y / 2) / y;
}
function rdiv(uint x, uint y) internal pure returns (uint z) {
z = add(mul(x, RAY), y / 2) / y;
}
// This famous algorithm is called "exponentiation by squaring"
// and calculates x^n with x as fixed-point and n as regular unsigned.
//
// It's O(log n), instead of O(n) for naive repeated multiplication.
//
// These facts are why it works:
//
// If n is even, then x^n = (x^2)^(n/2).
// If n is odd, then x^n = x * x^(n-1),
// and applying the equation for even x gives
// x^n = x * (x^2)^((n-1) / 2).
//
// Also, EVM division is flooring and
// floor[(n-1) / 2] = floor[n / 2].
//
function rpow(uint x, uint n) internal pure returns (uint z) {
z = n % 2 != 0 ? x : RAY;
for (n /= 2; n != 0; n /= 2) {
x = rmul(x, x);
if (n % 2 != 0) {
z = rmul(z, x);
}
}
}
}
////// lib/ds-thing/src/thing.sol
// thing.sol - `auth` with handy mixins. your things should be DSThings
// Copyright (C) 2017 DappHub, LLC
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
/* pragma solidity ^0.4.13; */
/* import 'ds-auth/auth.sol'; */
/* import 'ds-note/note.sol'; */
/* import 'ds-math/math.sol'; */
contract DSThing is DSAuth, DSNote, DSMath {
function S(string s) internal pure returns (bytes4) {
return bytes4(keccak256(s));
}
}
////// src/vox.sol
/// vox.sol -- target price feed
// Copyright (C) 2016, 2017 Nikolai Mushegian <nikolai@dapphub.com>
// Copyright (C) 2016, 2017 Daniel Brockman <daniel@dapphub.com>
// Copyright (C) 2017 Rain Break <rainbreak@riseup.net>
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
/* pragma solidity ^0.4.18; */
/* import "ds-thing/thing.sol"; */
contract SaiVox is DSThing {
uint256 _par;
uint256 _way;
uint256 public fix;
uint256 public how;
uint256 public tau;
function SaiVox(uint par_) public {
_par = fix = par_;
_way = RAY;
tau = era();
}
function era() public view returns (uint) {
return block.timestamp;
}
function mold(bytes32 param, uint val) public note auth {
if (param == 'way') _way = val;
}
// Dai Target Price (ref per dai)
function par() public returns (uint) {
prod();
return _par;
}
function way() public returns (uint) {
prod();
return _way;
}
function tell(uint256 ray) public note auth {
fix = ray;
}
function tune(uint256 ray) public note auth {
how = ray;
}
function prod() public note {
var age = era() - tau;
if (age == 0) return; // optimised
tau = era();
if (_way != RAY) _par = rmul(_par, rpow(_way, age)); // optimised
if (how == 0) return; // optimised
var wag = int128(how * age);
_way = inj(prj(_way) + (fix < _par ? wag : -wag));
}
function inj(int128 x) internal pure returns (uint256) {
return x >= 0 ? uint256(x) + RAY
: rdiv(RAY, RAY + uint256(-x));
}
function prj(uint256 x) internal pure returns (int128) {
return x >= RAY ? int128(x - RAY)
: int128(RAY) - int128(rdiv(RAY, x));
}
}
Compiler Settings
{"remappings":[],"optimizer":{"runs":200,"enabled":true},"libraries":{},"compilationTarget":{"SaiVox.sol":"SaiVox"}}
Contract ABI
[{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"prod","inputs":[],"constant":false},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"setOwner","inputs":[{"type":"address","name":"owner_"}],"constant":false},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"uint256","name":""}],"name":"era","inputs":[],"constant":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"uint256","name":""}],"name":"how","inputs":[],"constant":true},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[{"type":"uint256","name":""}],"name":"par","inputs":[],"constant":false},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"tell","inputs":[{"type":"uint256","name":"ray"}],"constant":false},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[{"type":"uint256","name":""}],"name":"way","inputs":[],"constant":false},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"setAuthority","inputs":[{"type":"address","name":"authority_"}],"constant":false},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"address","name":""}],"name":"owner","inputs":[],"constant":true},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"mold","inputs":[{"type":"bytes32","name":"param"},{"type":"uint256","name":"val"}],"constant":false},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"uint256","name":""}],"name":"fix","inputs":[],"constant":true},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"tune","inputs":[{"type":"uint256","name":"ray"}],"constant":false},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"address","name":""}],"name":"authority","inputs":[],"constant":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"uint256","name":""}],"name":"tau","inputs":[],"constant":true},{"type":"constructor","stateMutability":"nonpayable","payable":false,"inputs":[{"type":"uint256","name":"par_"}]},{"type":"event","name":"LogNote","inputs":[{"type":"bytes4","name":"sig","indexed":true},{"type":"address","name":"guy","indexed":true},{"type":"bytes32","name":"foo","indexed":true},{"type":"bytes32","name":"bar","indexed":true},{"type":"uint256","name":"wad","indexed":false},{"type":"bytes","name":"fax","indexed":false}],"anonymous":true},{"type":"event","name":"LogSetAuthority","inputs":[{"type":"address","name":"authority","indexed":true}],"anonymous":false},{"type":"event","name":"LogSetOwner","inputs":[{"type":"address","name":"owner","indexed":true}],"anonymous":false}]
Contract Creation Code
0x6060604052341561000f57600080fd5b6040516020806109b98339810160405280805160018054600160a060020a03191633600160a060020a031690811790915590925090507fce241d7ca1f669fee44b6fc00b8eba2df3bb514eed0f6f668f8f89096e81ed9460405160405180910390a2600481905560028190556b033b2e3c9fd0803ce80000006003556100a06401000000006103a56100a982021704565b600655506100ad565b4290565b6108fd806100bc6000396000f3006060604052600436106100cf5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630302c68881146100d457806313af4035146100e9578063143e55e0146101085780633a4a42331461012d578063495d32cb1461014057806355deb8fc146101535780635d6542af146101695780637a9e5e4b1461017c5780638da5cb5b1461019b57806392b0d721146101ca578063a551878e146101e3578063becda0ea146101f6578063bf7e214f1461020c578063cfc4af551461021f575b600080fd5b34156100df57600080fd5b6100e7610232565b005b34156100f457600080fd5b6100e7600160a060020a0360043516610326565b341561011357600080fd5b61011b6103a5565b60405190815260200160405180910390f35b341561013857600080fd5b61011b6103a9565b341561014b57600080fd5b61011b6103af565b341561015e57600080fd5b6100e76004356103c0565b341561017457600080fd5b61011b61043e565b341561018757600080fd5b6100e7600160a060020a036004351661044f565b34156101a657600080fd5b6101ae6104ce565b604051600160a060020a03909116815260200160405180910390f35b34156101d557600080fd5b6100e76004356024356104dd565b34156101ee57600080fd5b61011b610584565b341561020157600080fd5b6100e760043561058a565b341561021757600080fd5b6101ae610608565b341561022a57600080fd5b61011b610617565b6000806004356024358082600160a060020a033316600160e060020a031986351634873660405183815260406020820181815290820183905260608201848480828437820191505094505050505060405180910390a46006546102936103a5565b0393508315156102a257610320565b6102aa6103a5565b6006556003546b033b2e3c9fd0803ce8000000146102dd576102d96002546102d46003548761061d565b61067f565b6002555b60055415156102eb57610320565b8360055402925061031c60025460045410610309578360000361030b565b835b6103166003546106c2565b01610714565b6003555b50505050565b61033c33600035600160e060020a031916610765565b151561034757600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038381169190911791829055167fce241d7ca1f669fee44b6fc00b8eba2df3bb514eed0f6f668f8f89096e81ed9460405160405180910390a250565b4290565b60055481565b60006103b9610232565b5060025490565b600435602435808233600160a060020a031660008035600160e060020a0319169034903660405183815260406020820181815290820183905260608201848480828437820191505094505050505060405180910390a461042c33600035600160e060020a031916610765565b151561043757600080fd5b5050600455565b6000610448610232565b5060035490565b61046533600035600160e060020a031916610765565b151561047057600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038381169190911791829055167f1abebea81bfa2637f28358c371278fb15ede7ea8dd28d2e03b112ff6d936ada460405160405180910390a250565b600154600160a060020a031681565b600435602435808233600160a060020a031660008035600160e060020a0319169034903660405183815260406020820181815290820183905260608201848480828437820191505094505050505060405180910390a461054933600035600160e060020a031916610765565b151561055457600080fd5b7f776179000000000000000000000000000000000000000000000000000000000084141561032057505060035550565b60045481565b600435602435808233600160a060020a031660008035600160e060020a0319169034903660405183815260406020820181815290820183905260608201848480828437820191505094505050505060405180910390a46105f633600035600160e060020a031916610765565b151561060157600080fd5b5050600555565b600054600160a060020a031681565b60065481565b600060028206151561063b576b033b2e3c9fd0803ce800000061063d565b825b90506002820491505b811561067957610656838461067f565b9250600282061561066e5761066b818461067f565b90505b600282049150610646565b92915050565b60006b033b2e3c9fd0803ce80000006106b161069b8585610875565b60026b033b2e3c9fd0803ce80000005b0461089d565b8115156106ba57fe5b049392505050565b60006b033b2e3c9fd0803ce8000000821015610701576106ee6b033b2e3c9fd0803ce8000000836108ad565b6b033b2e3c9fd0803ce800000003610679565b506b033b2e3c9fd0803ce7ffffff190190565b60008082600f0b12156107505761074b6b033b2e3c9fd0803ce800000083600003600f0b6b033b2e3c9fd0803ce8000000016108ad565b610679565b50600f0b6b033b2e3c9fd0803ce80000000190565b600030600160a060020a031683600160a060020a0316141561078957506001610679565b600154600160a060020a03848116911614156107a757506001610679565b600054600160a060020a031615156107c157506000610679565b60008054600160a060020a03169063b700961390859030908690604051602001526040517c010000000000000000000000000000000000000000000000000000000063ffffffff8616028152600160a060020a039384166004820152919092166024820152600160e060020a03199091166044820152606401602060405180830381600087803b151561085357600080fd5b6102c65a03f1151561086457600080fd5b505050604051805190509050610679565b600081158061089257505080820282828281151561088f57fe5b04145b151561067957600080fd5b8082018281101561067957600080fd5b6000816106b16108c9856b033b2e3c9fd0803ce8000000610875565b6002856106ab5600a165627a7a7230582049958917661907d2cdc666ee71d7c74e2da9cf43be74359d7954fa654cd0f0f200290000000000000000000000000000000000000000033b2e3c9fd0803ce8000000
Deployed ByteCode
0x6060604052600436106100cf5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630302c68881146100d457806313af4035146100e9578063143e55e0146101085780633a4a42331461012d578063495d32cb1461014057806355deb8fc146101535780635d6542af146101695780637a9e5e4b1461017c5780638da5cb5b1461019b57806392b0d721146101ca578063a551878e146101e3578063becda0ea146101f6578063bf7e214f1461020c578063cfc4af551461021f575b600080fd5b34156100df57600080fd5b6100e7610232565b005b34156100f457600080fd5b6100e7600160a060020a0360043516610326565b341561011357600080fd5b61011b6103a5565b60405190815260200160405180910390f35b341561013857600080fd5b61011b6103a9565b341561014b57600080fd5b61011b6103af565b341561015e57600080fd5b6100e76004356103c0565b341561017457600080fd5b61011b61043e565b341561018757600080fd5b6100e7600160a060020a036004351661044f565b34156101a657600080fd5b6101ae6104ce565b604051600160a060020a03909116815260200160405180910390f35b34156101d557600080fd5b6100e76004356024356104dd565b34156101ee57600080fd5b61011b610584565b341561020157600080fd5b6100e760043561058a565b341561021757600080fd5b6101ae610608565b341561022a57600080fd5b61011b610617565b6000806004356024358082600160a060020a033316600160e060020a031986351634873660405183815260406020820181815290820183905260608201848480828437820191505094505050505060405180910390a46006546102936103a5565b0393508315156102a257610320565b6102aa6103a5565b6006556003546b033b2e3c9fd0803ce8000000146102dd576102d96002546102d46003548761061d565b61067f565b6002555b60055415156102eb57610320565b8360055402925061031c60025460045410610309578360000361030b565b835b6103166003546106c2565b01610714565b6003555b50505050565b61033c33600035600160e060020a031916610765565b151561034757600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038381169190911791829055167fce241d7ca1f669fee44b6fc00b8eba2df3bb514eed0f6f668f8f89096e81ed9460405160405180910390a250565b4290565b60055481565b60006103b9610232565b5060025490565b600435602435808233600160a060020a031660008035600160e060020a0319169034903660405183815260406020820181815290820183905260608201848480828437820191505094505050505060405180910390a461042c33600035600160e060020a031916610765565b151561043757600080fd5b5050600455565b6000610448610232565b5060035490565b61046533600035600160e060020a031916610765565b151561047057600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038381169190911791829055167f1abebea81bfa2637f28358c371278fb15ede7ea8dd28d2e03b112ff6d936ada460405160405180910390a250565b600154600160a060020a031681565b600435602435808233600160a060020a031660008035600160e060020a0319169034903660405183815260406020820181815290820183905260608201848480828437820191505094505050505060405180910390a461054933600035600160e060020a031916610765565b151561055457600080fd5b7f776179000000000000000000000000000000000000000000000000000000000084141561032057505060035550565b60045481565b600435602435808233600160a060020a031660008035600160e060020a0319169034903660405183815260406020820181815290820183905260608201848480828437820191505094505050505060405180910390a46105f633600035600160e060020a031916610765565b151561060157600080fd5b5050600555565b600054600160a060020a031681565b60065481565b600060028206151561063b576b033b2e3c9fd0803ce800000061063d565b825b90506002820491505b811561067957610656838461067f565b9250600282061561066e5761066b818461067f565b90505b600282049150610646565b92915050565b60006b033b2e3c9fd0803ce80000006106b161069b8585610875565b60026b033b2e3c9fd0803ce80000005b0461089d565b8115156106ba57fe5b049392505050565b60006b033b2e3c9fd0803ce8000000821015610701576106ee6b033b2e3c9fd0803ce8000000836108ad565b6b033b2e3c9fd0803ce800000003610679565b506b033b2e3c9fd0803ce7ffffff190190565b60008082600f0b12156107505761074b6b033b2e3c9fd0803ce800000083600003600f0b6b033b2e3c9fd0803ce8000000016108ad565b610679565b50600f0b6b033b2e3c9fd0803ce80000000190565b600030600160a060020a031683600160a060020a0316141561078957506001610679565b600154600160a060020a03848116911614156107a757506001610679565b600054600160a060020a031615156107c157506000610679565b60008054600160a060020a03169063b700961390859030908690604051602001526040517c010000000000000000000000000000000000000000000000000000000063ffffffff8616028152600160a060020a039384166004820152919092166024820152600160e060020a03199091166044820152606401602060405180830381600087803b151561085357600080fd5b6102c65a03f1151561086457600080fd5b505050604051805190509050610679565b600081158061089257505080820282828281151561088f57fe5b04145b151561067957600080fd5b8082018281101561067957600080fd5b6000816106b16108c9856b033b2e3c9fd0803ce8000000610875565b6002856106ab5600a165627a7a7230582049958917661907d2cdc666ee71d7c74e2da9cf43be74359d7954fa654cd0f0f20029