Contract 0x17f8ab5dcfd4d635efdacba484c4db215ea82806 3

 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0xa4c02c1d98e6ffe2864535575915cf83caf55d98bab38a2ed15739f7bf0d71140x60c06040151850462022-06-20 17:29:11170 days 8 hrs ago0xc36142c497053c42bdaa14737bf80e71daa984c5 IN  Create: ConnectV2DSASpellArbitrum0 ETH0.003835470837 ETH
[ Download CSV Export 
Latest 1 internal transaction
Parent Txn Hash Block From To Value
0xae0d765bfc99facbead5ad4ab1eae2e1fb04a269d584650e8682a8f586f347e4152514222022-06-21 12:12:17169 days 14 hrs ago 0x67fce99dd6d8d659eea2a1ac1b8881c57eb6592b 0x17f8ab5dcfd4d635efdacba484c4db215ea828060 ETH
[ Download CSV Export 
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.

Contract Source Code Verified (Exact Match)

Contract Name:
ConnectV2DSASpellArbitrum

Compiler Version
v0.7.6+commit.7338295f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 4 : main.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
pragma experimental ABIEncoderV2;

/**
 * @title DSA Spell.
 * @dev Cast spells on DSA.
 */

import { AccountInterface } from "../../common/interfaces.sol";
import { Stores } from "../../common/stores.sol";
import { Events } from "./events.sol";

abstract contract DSASpellsResolver is Events, Stores {
	/**
	 *@dev Casts spells on a DSA, caller DSA should be an auth of the target DSA. Reverts if any spell failed.
	 *@notice Interact with a target DSA by casting spells on it.
	 *@param targetDSA target DSA to cast spells on.
	 *@param connectors Array of connector names (For example, ["1INCH-A", "BASIC-A"]).
	 *@param datas Array of connector calldatas (function selectors encoded with parameters).
	 */
	function castOnDSA(
		address targetDSA,
		string[] memory connectors,
		bytes[] memory datas
	)
		external
		payable
		returns (string memory _eventName, bytes memory _eventParam)
	{
		require(instaList.accountID(targetDSA) != 0, "not-a-DSA");

		AccountInterface(targetDSA).cast(connectors, datas, address(this));

		_eventName = "LogCastOnDSA(address,string[],bytes[])";
		_eventParam = abi.encode(targetDSA, connectors, datas);
	}

	/**
	 *@dev Casts spell on caller DSA. Stops casting further spells as soon as a spell gets casted successfully.
	 * Reverts if none of the spells is successful.
	 *@notice Casts the first successful spell on the DSA.
	 *@param connectors Array of connector names, in preference order, if any (For example, ["1INCH-A", "ZEROX-A"]).
	 *@param datas Array of connector calldatas (function selectors encoded with parameters).
	 */
	function castAny(string[] memory connectors, bytes[] memory datas)
		external
		payable
		returns (string memory eventName, bytes memory eventParam)
	{
		uint256 _length = connectors.length;
		require(_length > 0, "zero-length-not-allowed");
		require(datas.length == _length, "calldata-length-invalid");

		(bool isOk, address[] memory _connectors) = instaConnectors
			.isConnectors(connectors);
		require(isOk, "connector-names-invalid");

		string memory _connectorName;
		string memory _eventName;
		bytes memory _eventParam;
		bytes memory returnData;
		bool success;

		for (uint256 i = 0; i < _length; i++) {
			(success, returnData) = _connectors[i].delegatecall(datas[i]);

			if (success) {
				_connectorName = connectors[i];
				(_eventName, _eventParam) = abi.decode(
					returnData,
					(string, bytes)
				);
				break;
			}
		}
		require(success, "dsa-spells-failed");

		eventName = "LogCastAny(string[],string,string,bytes)";
		eventParam = abi.encode(
			connectors,
			_connectorName,
			_eventName,
			_eventParam
		);
	}
}

contract ConnectV2DSASpellArbitrum is DSASpellsResolver {
	string public name = "DSA-Spell-v1.0";
}

File 2 of 4 : interfaces.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
pragma abicoder v2;

interface TokenInterface {
    function approve(address, uint256) external;
    function transfer(address, uint) external;
    function transferFrom(address, address, uint) external;
    function deposit() external payable;
    function withdraw(uint) external;
    function balanceOf(address) external view returns (uint);
    function decimals() external view returns (uint);
}

interface MemoryInterface {
    function getUint(uint id) external returns (uint num);
    function setUint(uint id, uint val) external;
}

interface InstaMapping {
    function cTokenMapping(address) external view returns (address);
    function gemJoinMapping(bytes32) external view returns (address);
}

interface AccountInterface {
    function enable(address) external;
    function disable(address) external;
    function isAuth(address) external view returns (bool);
    function cast(
        string[] calldata _targetNames,
        bytes[] calldata _datas,
        address _origin
    ) external payable returns (bytes32[] memory responses);
}

interface ListInterface {
    function accountID(address) external returns (uint64);
}

interface InstaConnectors {
    function isConnectors(string[] calldata) external returns (bool, address[] memory);
}

File 3 of 4 : stores.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;

import { MemoryInterface, InstaMapping, ListInterface, InstaConnectors } from "./interfaces.sol";


abstract contract Stores {

  /**
   * @dev Return ethereum address
   */
  address constant internal ethAddr = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;

  /**
   * @dev Return Wrapped ETH address
   */
  address constant internal wethAddr = 0x82aF49447D8a07e3bd95BD0d56f35241523fBab1;

  /**
   * @dev Return memory variable address
   */
  MemoryInterface constant internal instaMemory = MemoryInterface(0xc109f7Ef06152c3a63dc7254fD861E612d3Ac571);

  /**
   * @dev Return InstaList address
   */
  ListInterface internal constant instaList = ListInterface(0x3565F6057b7fFE36984779A507fC87b31EFb0f09);

  /**
   * @dev Return connectors registry address
   */
  InstaConnectors internal constant instaConnectors = InstaConnectors(0x67fCE99Dd6d8d659eea2a1ac1b8881c57eb6592B);

  /**
   * @dev Get Uint value from InstaMemory Contract.
   */
  function getUint(uint getId, uint val) internal returns (uint returnVal) {
    returnVal = getId == 0 ? val : instaMemory.getUint(getId);
  }

  /**
  * @dev Set Uint value in InstaMemory Contract.
  */
  function setUint(uint setId, uint val) virtual internal {
    if (setId != 0) instaMemory.setUint(setId, val);
  }

}

File 4 of 4 : events.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
pragma abicoder v2;

contract Events {
	event LogCastOnDSA(
		address indexed targetDSA,
		string[] connectors,
		bytes[] datas
	);
	event LogCastAny(
		string[] connectors,
		string connectorName,
		string eventName,
		bytes eventParam
	);
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "metadata": {
    "useLiteralContent": true
  },
  "libraries": {}
}

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string[]","name":"connectors","type":"string[]"},{"indexed":false,"internalType":"string","name":"connectorName","type":"string"},{"indexed":false,"internalType":"string","name":"eventName","type":"string"},{"indexed":false,"internalType":"bytes","name":"eventParam","type":"bytes"}],"name":"LogCastAny","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"targetDSA","type":"address"},{"indexed":false,"internalType":"string[]","name":"connectors","type":"string[]"},{"indexed":false,"internalType":"bytes[]","name":"datas","type":"bytes[]"}],"name":"LogCastOnDSA","type":"event"},{"inputs":[{"internalType":"string[]","name":"connectors","type":"string[]"},{"internalType":"bytes[]","name":"datas","type":"bytes[]"}],"name":"castAny","outputs":[{"internalType":"string","name":"eventName","type":"string"},{"internalType":"bytes","name":"eventParam","type":"bytes"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"targetDSA","type":"address"},{"internalType":"string[]","name":"connectors","type":"string[]"},{"internalType":"bytes[]","name":"datas","type":"bytes[]"}],"name":"castOnDSA","outputs":[{"internalType":"string","name":"_eventName","type":"string"},{"internalType":"bytes","name":"_eventParam","type":"bytes"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}]

60c0604052600e60808190526d04453412d5370656c6c2d76312e360941b60a090815261002f9160009190610042565b5034801561003c57600080fd5b506100e3565b828054600181600116156101000203166002900490600052602060002090601f01602090048101928261007857600085556100be565b82601f1061009157805160ff19168380011785556100be565b828001600101855582156100be579182015b828111156100be5782518255916020019190600101906100a3565b506100ca9291506100ce565b5090565b5b808211156100ca57600081556001016100cf565b610d48806100f26000396000f3fe6080604052600436106100345760003560e01c806306fdde0314610039578063a8e2185f14610064578063eae01d3514610085575b600080fd5b34801561004557600080fd5b5061004e610098565b60405161005b9190610ae4565b60405180910390f35b610077610072366004610646565b610126565b60405161005b929190610af7565b610077610093366004610749565b6102b3565b6000805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561011e5780601f106100f35761010080835404028352916020019161011e565b820191906000526020600020905b81548152906001019060200180831161010157829003601f168201915b505050505081565b604051636cfaf5e960e01b81526060908190733565f6057b7ffe36984779a507fc87b31efb0f0990636cfaf5e9906101629088906004016109e7565b602060405180830381600087803b15801561017c57600080fd5b505af1158015610190573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101b491906108de565b67ffffffffffffffff166101e35760405162461bcd60e51b81526004016101da90610bf5565b60405180910390fd5b6040516324c1324d60e21b81526001600160a01b03861690639304c9349061021390879087903090600401610a4e565b600060405180830381600087803b15801561022d57600080fd5b505af1158015610241573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261026991908101906106b9565b50604051806060016040528060268152602001610ced60269139915084848460405160200161029a939291906109fb565b6040516020818303038152906040529050935093915050565b81516060908190806102d75760405162461bcd60e51b81526004016101da90610b87565b808451146102f75760405162461bcd60e51b81526004016101da90610b25565b60405163a0a32c0b60e01b815260009081907367fce99dd6d8d659eea2a1ac1b8881c57eb6592b9063a0a32c0b90610333908a90600401610a3b565b600060405180830381600087803b15801561034d57600080fd5b505af1158015610361573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261038991908101906107aa565b91509150816103aa5760405162461bcd60e51b81526004016101da90610bbe565b60608080806000805b88811015610480578681815181106103c757fe5b60200260200101516001600160a01b03168c82815181106103e457fe5b60200260200101516040516103f991906109cb565b600060405180830381855af49150503d8060008114610434576040519150601f19603f3d011682016040523d82523d6000602084013e610439565b606091505b50935091508115610478578c818151811061045057fe5b602002602001015195508280602001905181019061046e919061085e565b9095509350610480565b6001016103b3565b508061049e5760405162461bcd60e51b81526004016101da90610b5c565b604051806060016040528060288152602001610cc56028913999508b8585856040516020016104d09493929190610a8c565b604051602081830303815290604052985050505050505050509250929050565b60006105036104fe84610c5a565b610c18565b905082815283838301111561051757600080fd5b828260208301376000602084830101529392505050565b600061053c6104fe84610c5a565b905082815283838301111561055057600080fd5b61055e836020830184610c7c565b9392505050565b600082601f830112610575578081fd5b813560206105856104fe83610c3c565b82815281810190858301855b858110156105cf578135880189603f8201126105ab578788fd5b6105bc8a87830135604084016104f0565b8552509284019290840190600101610591565b5090979650505050505050565b600082601f8301126105ec578081fd5b813560206105fc6104fe83610c3c565b82815281810190858301855b858110156105cf578135880189603f820112610622578788fd5b6106338a87830135604084016104f0565b8552509284019290840190600101610608565b60008060006060848603121561065a578283fd5b833561066581610cac565b9250602084013567ffffffffffffffff80821115610681578384fd5b61068d878388016105dc565b935060408601359150808211156106a2578283fd5b506106af86828701610565565b9150509250925092565b600060208083850312156106cb578182fd5b825167ffffffffffffffff8111156106e1578283fd5b8301601f810185136106f1578283fd5b80516106ff6104fe82610c3c565b818152838101908385018584028501860189101561071b578687fd5b8694505b8385101561073d57805183526001949094019391850191850161071f565b50979650505050505050565b6000806040838503121561075b578182fd5b823567ffffffffffffffff80821115610772578384fd5b61077e868387016105dc565b93506020850135915080821115610793578283fd5b506107a085828601610565565b9150509250929050565b600080604083850312156107bc578182fd5b825180151581146107cb578283fd5b8092505060208084015167ffffffffffffffff8111156107e9578283fd5b8401601f810186136107f9578283fd5b80516108076104fe82610c3c565b81815283810190838501858402850186018a1015610823578687fd5b8694505b8385101561084e57805161083a81610cac565b835260019490940193918501918501610827565b5080955050505050509250929050565b60008060408385031215610870578182fd5b825167ffffffffffffffff80821115610887578384fd5b818501915085601f83011261089a578384fd5b6108a98683516020850161052e565b935060208501519150808211156108be578283fd5b508301601f810185136108cf578182fd5b6107a08582516020840161052e565b6000602082840312156108ef578081fd5b815167ffffffffffffffff8116811461055e578182fd5b6000815180845260208085018081965082840281019150828601855b8581101561094c57828403895261093a84835161099f565b98850198935090840190600101610922565b5091979650505050505050565b6000815180845260208085018081965082840281019150828601855b8581101561094c57828403895261098d84835161099f565b98850198935090840190600101610975565b600081518084526109b7816020860160208601610c7c565b601f01601f19169290920160200192915050565b600082516109dd818460208701610c7c565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b0384168152606060208201819052600090610a1f90830185610959565b8281036040840152610a318185610906565b9695505050505050565b60006020825261055e6020830184610959565b600060608252610a616060830186610959565b8281036020840152610a738186610906565b91505060018060a01b0383166040830152949350505050565b600060808252610a9f6080830187610959565b8281036020840152610ab1818761099f565b90508281036040840152610ac5818661099f565b90508281036060840152610ad9818561099f565b979650505050505050565b60006020825261055e602083018461099f565b600060408252610b0a604083018561099f565b8281036020840152610b1c818561099f565b95945050505050565b60208082526017908201527f63616c6c646174612d6c656e6774682d696e76616c6964000000000000000000604082015260600190565b602080825260119082015270191cd84b5cdc195b1b1ccb59985a5b1959607a1b604082015260600190565b60208082526017908201527f7a65726f2d6c656e6774682d6e6f742d616c6c6f776564000000000000000000604082015260600190565b60208082526017908201527f636f6e6e6563746f722d6e616d65732d696e76616c6964000000000000000000604082015260600190565b6020808252600990820152686e6f742d612d44534160b81b604082015260600190565b60405181810167ffffffffffffffff81118282101715610c3457fe5b604052919050565b600067ffffffffffffffff821115610c5057fe5b5060209081020190565b600067ffffffffffffffff821115610c6e57fe5b50601f01601f191660200190565b60005b83811015610c97578181015183820152602001610c7f565b83811115610ca6576000848401525b50505050565b6001600160a01b0381168114610cc157600080fd5b5056fe4c6f6743617374416e7928737472696e675b5d2c737472696e672c737472696e672c6279746573294c6f67436173744f6e44534128616464726573732c737472696e675b5d2c62797465735b5d29a2646970667358221220a733b897bbbbc4d9fbce266947d16401be76ef02a3e7a8ab449421c029a27bee64736f6c63430007060033

Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.