false
true
0

Contract Address Details

0x01Adb2936905d2F44c63772a93BC92934e3CDA2d

Contract Name
DSProxy
Creator
0x1043fb–f945e6 at 0x72c4dc–225827
Balance
0 PLS ( )
Tokens
Fetching tokens...
Transactions
30 Transactions
Transfers
0 Transfers
Gas Used
0
Last Balance Update
27873653
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:
DSProxy




Optimization enabled
true
Compiler version
v0.4.20+commit.3155dd80




Optimization runs
200
Verified at
2026-04-22T07:42:43.427192Z

Constructor Arguments

000000000000000000000000900ef39a13382fdb9cdca9e840c1faad7d6f6fe2

Arg [0] (address) : 0x900ef39a13382fdb9cdca9e840c1faad7d6f6fe2

              

DSProxy.sol

// proxy.sol - execute actions atomically through the proxy's identity

// 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;

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);
        }
    }
}

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);

        _;
    }
}

// DSProxy
// Allows code execution using a persistant identity This can be very
// useful to execute a sequence of atomic actions. Since the owner of
// the proxy can be changed, this allows for dynamic ownership models
// i.e. a multisig
contract DSProxy is DSAuth, DSNote {
    DSProxyCache public cache;  // global cache for contracts

    function DSProxy(address _cacheAddr) public {
        require(setCache(_cacheAddr));
    }

    function() public payable {
    }

    // use the proxy to execute calldata _data on contract _code
    function execute(bytes _code, bytes _data)
        public
        payable
        returns (address target, bytes32 response)
    {
        target = cache.read(_code);
        if (target == 0x0) {
            // deploy contract & store its address in cache
            target = cache.write(_code);
        }

        response = execute(target, _data);
    }

    function execute(address _target, bytes _data)
        public
        auth
        note
        payable
        returns (bytes32 response)
    {
        require(_target != 0x0);

        // call contract in current context
        assembly {
            let succeeded := delegatecall(sub(gas, 5000), _target, add(_data, 0x20), mload(_data), 0, 32)
            response := mload(0)      // load delegatecall output
            switch iszero(succeeded)
            case 1 {
                // throw if delegatecall failed
                revert(0, 0)
            }
        }
    }

    //set new cache
    function setCache(address _cacheAddr)
        public
        auth
        note
        returns (bool)
    {
        require(_cacheAddr != 0x0);        // invalid cache address
        cache = DSProxyCache(_cacheAddr);  // overwrite cache
        return true;
    }
}

// DSProxyCache
// This global cache stores addresses of contracts previously deployed
// by a proxy. This saves gas from repeat deployment of the same
// contracts and eliminates blockchain bloat.

// By default, all proxies deployed from the same factory store
// contracts in the same cache. The cache a proxy instance uses can be
// changed.  The cache uses the sha3 hash of a contract's bytecode to
// lookup the address
contract DSProxyCache {
    mapping(bytes32 => address) cache;

    function read(bytes _code) public view returns (address) {
        bytes32 hash = keccak256(_code);
        return cache[hash];
    }

    function write(bytes _code) public returns (address target) {
        assembly {
            target := create(0, add(_code, 0x20), mload(_code))
            switch iszero(extcodesize(target))
            case 1 {
                // throw if contract failed to deploy
                revert(0, 0)
            }
        }
        bytes32 hash = keccak256(_code);
        cache[hash] = target;
    }
}
        

Compiler Settings

{"remappings":[],"optimizer":{"runs":200,"enabled":true},"libraries":{},"compilationTarget":{"DSProxy.sol":"DSProxy"}}
              

Contract ABI

[{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"setOwner","inputs":[{"type":"address","name":"owner_"}],"constant":false},{"type":"function","stateMutability":"payable","payable":true,"outputs":[{"type":"bytes32","name":"response"}],"name":"execute","inputs":[{"type":"address","name":"_target"},{"type":"bytes","name":"_data"}],"constant":false},{"type":"function","stateMutability":"payable","payable":true,"outputs":[{"type":"address","name":"target"},{"type":"bytes32","name":"response"}],"name":"execute","inputs":[{"type":"bytes","name":"_code"},{"type":"bytes","name":"_data"}],"constant":false},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"address","name":""}],"name":"cache","inputs":[],"constant":true},{"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":[{"type":"bool","name":""}],"name":"setCache","inputs":[{"type":"address","name":"_cacheAddr"}],"constant":false},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"address","name":""}],"name":"authority","inputs":[],"constant":true},{"type":"constructor","stateMutability":"nonpayable","payable":false,"inputs":[{"type":"address","name":"_cacheAddr"}]},{"type":"fallback","stateMutability":"payable","payable":true},{"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

Verify & Publish
0x6060604052341561000f57600080fd5b604051602080610aac8339810160405280805160018054600160a060020a03191633600160a060020a031690811790915590925090507fce241d7ca1f669fee44b6fc00b8eba2df3bb514eed0f6f668f8f89096e81ed9460405160405180910390a2610087816401000000006105f461009882021704565b151561009257600080fd5b506102b3565b60006100d4337fffffffff000000000000000000000000000000000000000000000000000000008335166401000000006106c661018a82021704565b15156100df57600080fd5b600435602435808233600160a060020a0316600080357fffffffff00000000000000000000000000000000000000000000000000000000169034903660405183815260406020820181815290820183905260608201848480828437820191505094505050505060405180910390a4600160a060020a038416151561016257600080fd5b60028054600160a060020a038616600160a060020a0319909116179055600192505050919050565b600030600160a060020a031683600160a060020a031614156101ae575060016102ad565b600154600160a060020a03848116911614156101cc575060016102ad565b600054600160a060020a031615156101e6575060006102ad565b60008054600160a060020a03169063b700961390859030908690604051602001526040517c010000000000000000000000000000000000000000000000000000000063ffffffff8616028152600160a060020a0393841660048201529190921660248201527fffffffff000000000000000000000000000000000000000000000000000000009091166044820152606401602060405180830381600087803b151561029057600080fd5b6102c65a03f115156102a157600080fd5b50505060405180519150505b92915050565b6107ea806102c26000396000f3006060604052600436106100745763ffffffff60e060020a60003504166313af403581146100765780631cff79cd146100955780631f6a1eb9146100fb57806360c7d295146101a55780637a9e5e4b146101d45780638da5cb5b146101f3578063948f507614610206578063bf7e214f14610239575b005b341561008157600080fd5b610074600160a060020a036004351661024c565b6100e960048035600160a060020a03169060446024803590810190830135806020601f820181900481020160405190810160405281815292919060208401838380828437509496506102cb95505050505050565b60405190815260200160405180910390f35b61018360046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284375094965061038d95505050505050565b604051600160a060020a03909216825260208201526040908101905180910390f35b34156101b057600080fd5b6101b8610557565b604051600160a060020a03909116815260200160405180910390f35b34156101df57600080fd5b610074600160a060020a0360043516610566565b34156101fe57600080fd5b6101b86105e5565b341561021157600080fd5b610225600160a060020a03600435166105f4565b604051901515815260200160405180910390f35b341561024457600080fd5b6101b86106b7565b61026233600035600160e060020a0319166106c6565b151561026d57600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038381169190911791829055167fce241d7ca1f669fee44b6fc00b8eba2df3bb514eed0f6f668f8f89096e81ed9460405160405180910390a250565b60006102e333600035600160e060020a0319166106c6565b15156102ee57600080fd5b600435602435808233600160a060020a031660008035600160e060020a0319169034903660405183815260406020820181815290820183905260608201848480828437820191505094505050505060405180910390a4600160a060020a038516151561035957600080fd5b60206000855160208701886113885a03f4600051935080156001811461037e57610383565b600080fd5b5050505092915050565b6002546000908190600160a060020a0316638bf4515c8583604051602001526040518263ffffffff1660e060020a0281526004018080602001828103825283818151815260200191508051906020019080838360005b838110156103fb5780820151838201526020016103e3565b50505050905090810190601f1680156104285780820380516001836020036101000a031916815260200191505b5092505050602060405180830381600087803b151561044657600080fd5b6102c65a03f1151561045757600080fd5b5050506040518051925050600160a060020a038216151561054457600254600160a060020a0316637ed0c3b2856000604051602001526040518263ffffffff1660e060020a0281526004018080602001828103825283818151815260200191508051906020019080838360005b838110156104dc5780820151838201526020016104c4565b50505050905090810190601f1680156105095780820380516001836020036101000a031916815260200191505b5092505050602060405180830381600087803b151561052757600080fd5b6102c65a03f1151561053857600080fd5b50505060405180519250505b61054e82846102cb565b90509250929050565b600254600160a060020a031681565b61057c33600035600160e060020a0319166106c6565b151561058757600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038381169190911791829055167f1abebea81bfa2637f28358c371278fb15ede7ea8dd28d2e03b112ff6d936ada460405160405180910390a250565b600154600160a060020a031681565b600061060c33600035600160e060020a0319166106c6565b151561061757600080fd5b600435602435808233600160a060020a031660008035600160e060020a0319169034903660405183815260406020820181815290820183905260608201848480828437820191505094505050505060405180910390a4600160a060020a038416151561068257600080fd5b60028054600160a060020a03861673ffffffffffffffffffffffffffffffffffffffff19909116179055600192505050919050565b600054600160a060020a031681565b600030600160a060020a031683600160a060020a031614156106ea575060016107b8565b600154600160a060020a0384811691161415610708575060016107b8565b600054600160a060020a03161515610722575060006107b8565b60008054600160a060020a03169063b7009613908590309086906040516020015260405160e060020a63ffffffff8616028152600160a060020a039384166004820152919092166024820152600160e060020a03199091166044820152606401602060405180830381600087803b151561079b57600080fd5b6102c65a03f115156107ac57600080fd5b50505060405180519150505b929150505600a165627a7a72305820901edca420ef717883bde8fe7b7414ee8d5e8f33fa50e674cb3d9262e05ab6c50029000000000000000000000000900ef39a13382fdb9cdca9e840c1faad7d6f6fe2

Deployed ByteCode

0x6060604052600436106100745763ffffffff60e060020a60003504166313af403581146100765780631cff79cd146100955780631f6a1eb9146100fb57806360c7d295146101a55780637a9e5e4b146101d45780638da5cb5b146101f3578063948f507614610206578063bf7e214f14610239575b005b341561008157600080fd5b610074600160a060020a036004351661024c565b6100e960048035600160a060020a03169060446024803590810190830135806020601f820181900481020160405190810160405281815292919060208401838380828437509496506102cb95505050505050565b60405190815260200160405180910390f35b61018360046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284375094965061038d95505050505050565b604051600160a060020a03909216825260208201526040908101905180910390f35b34156101b057600080fd5b6101b8610557565b604051600160a060020a03909116815260200160405180910390f35b34156101df57600080fd5b610074600160a060020a0360043516610566565b34156101fe57600080fd5b6101b86105e5565b341561021157600080fd5b610225600160a060020a03600435166105f4565b604051901515815260200160405180910390f35b341561024457600080fd5b6101b86106b7565b61026233600035600160e060020a0319166106c6565b151561026d57600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038381169190911791829055167fce241d7ca1f669fee44b6fc00b8eba2df3bb514eed0f6f668f8f89096e81ed9460405160405180910390a250565b60006102e333600035600160e060020a0319166106c6565b15156102ee57600080fd5b600435602435808233600160a060020a031660008035600160e060020a0319169034903660405183815260406020820181815290820183905260608201848480828437820191505094505050505060405180910390a4600160a060020a038516151561035957600080fd5b60206000855160208701886113885a03f4600051935080156001811461037e57610383565b600080fd5b5050505092915050565b6002546000908190600160a060020a0316638bf4515c8583604051602001526040518263ffffffff1660e060020a0281526004018080602001828103825283818151815260200191508051906020019080838360005b838110156103fb5780820151838201526020016103e3565b50505050905090810190601f1680156104285780820380516001836020036101000a031916815260200191505b5092505050602060405180830381600087803b151561044657600080fd5b6102c65a03f1151561045757600080fd5b5050506040518051925050600160a060020a038216151561054457600254600160a060020a0316637ed0c3b2856000604051602001526040518263ffffffff1660e060020a0281526004018080602001828103825283818151815260200191508051906020019080838360005b838110156104dc5780820151838201526020016104c4565b50505050905090810190601f1680156105095780820380516001836020036101000a031916815260200191505b5092505050602060405180830381600087803b151561052757600080fd5b6102c65a03f1151561053857600080fd5b50505060405180519250505b61054e82846102cb565b90509250929050565b600254600160a060020a031681565b61057c33600035600160e060020a0319166106c6565b151561058757600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038381169190911791829055167f1abebea81bfa2637f28358c371278fb15ede7ea8dd28d2e03b112ff6d936ada460405160405180910390a250565b600154600160a060020a031681565b600061060c33600035600160e060020a0319166106c6565b151561061757600080fd5b600435602435808233600160a060020a031660008035600160e060020a0319169034903660405183815260406020820181815290820183905260608201848480828437820191505094505050505060405180910390a4600160a060020a038416151561068257600080fd5b60028054600160a060020a03861673ffffffffffffffffffffffffffffffffffffffff19909116179055600192505050919050565b600054600160a060020a031681565b600030600160a060020a031683600160a060020a031614156106ea575060016107b8565b600154600160a060020a0384811691161415610708575060016107b8565b600054600160a060020a03161515610722575060006107b8565b60008054600160a060020a03169063b7009613908590309086906040516020015260405160e060020a63ffffffff8616028152600160a060020a039384166004820152919092166024820152600160e060020a03199091166044820152606401602060405180830381600087803b151561079b57600080fd5b6102c65a03f115156107ac57600080fd5b50505060405180519150505b929150505600a165627a7a72305820901edca420ef717883bde8fe7b7414ee8d5e8f33fa50e674cb3d9262e05ab6c50029