Address Contract Verified
Address
0xB898246Cb640CCF720994f356F82753036f564b8
Balance
0 ETH
Nonce
12
Code Size
5006 bytes
Creator
Create2 Deployer at tx 0x470593c3...2cd706
Indexed Transactions
0
Contract Bytecode
5006 bytes
0x608060405260043610156200001357600080fd5b60003560e01c806343d41f99146200006c5780634f133c70146200006657806354fd4d5014620000605780637b103999146200005a5763fd746e43036200008157620003bc565b6200033b565b620002db565b6200029b565b620000c1565b90816060910312620000815790565b600080fd5b906020828203126200008157813567ffffffffffffffff81116200008157620000b0920162000072565b90565b6001600160a01b031690565b565b346200008157620000fc620000e2620000dc36600462000086565b6200059a565b604051918291826001600160a01b03909116815260200190565b0390f35b634e487b7160e01b600052604160045260246000fd5b90601f01601f1916810190811067ffffffffffffffff8211176200013957604052565b62000100565b90620000bf6200014e60405190565b928362000116565b6001600160a01b0381165b036200008157565b90503590620000bf8262000156565b67ffffffffffffffff81116200013957602090601f01601f19160190565b0190565b90826000939282370152565b90929192620001bf620001b98262000178565b6200013f565b938185526020850190828401116200008157620000bf926200019a565b9080601f830112156200008157816020620000b093359101620001a6565b91909160408184031262000081576200021460406200013f565b9262000221818362000169565b8452602082013567ffffffffffffffff81116200008157620002449201620001dc565b6020830152565b9190916040818403126200008157803567ffffffffffffffff81116200008157836200027991830162000072565b92602082013567ffffffffffffffff81116200008157620000b09201620001fa565b346200008157620000fc620002bd620002b63660046200024b565b9062000701565b60405191829182901515815260200190565b60009103126200008157565b346200008157620002ee366004620002cf565b620000fc620002fc6200078a565b6040519182918290815260200190565b620000b0916008021c6001600160a01b031690565b90620000b091546200030c565b620000b060008062000321565b3462000081576200034e366004620002cf565b620000fc620000e26200032e565b8062000161565b90503590620000bf826200035c565b9160608383031262000081576200038a828462000169565b926200039a836020830162000363565b92604082013567ffffffffffffffff81116200008157620000b09201620001dc565b346200008157620000fc620002bd620003d736600462000372565b9162000794565b903590605e19368290030182121562000081570190565b35620000b08162000156565b9035605e19368390030181121562000081570190565b50620000b090602081019062000169565b9035601e1936839003018112156200008157016020813591019167ffffffffffffffff821162000081573682900383136200008157565b919062000481816200047981620001969560209181520190565b80956200019a565b601f01601f191690565b620000b091620004e3620004d760608301620004b9620004ac868062000417565b6001600160a01b03168552565b620004c8602086018662000428565b9085830360208701526200045f565b92604081019062000428565b9160408185039101526200045f565b620000b091620004e3620004d7620004b96060840162000513868062000401565b85820386526200048b565b6020808252620000b092910190620004f2565b6040513d6000823e3d90fd5b620000b090620000b3906001600160a01b031682565b620000b0906200053d565b620000b09062000553565b620000b090620000b3565b620000b0905462000569565b6001600160a01b0391821681529116602082015260400190565b33620005c9620005bc620000b36000620005b58680620003de565b01620003f5565b916001600160a01b031690565b03620006ef576040519061092d820182811067ffffffffffffffff82111762000139578291620006029161092d62000a2c85396200051e565b03906000f08015620006e95762000619906200055e565b620006336200062d6200062d600062000574565b6200055e565b63befe2323338392803b1562000081576200066660008094620006726200065960405190565b9788968795869460e01b90565b84526004840162000580565b03925af18015620006e957620006c6575b5033817fd0b7d5b4b78acfb06009605c06cadd246a05928fb009f6c3d57ed3b42b97178f91620006c0620006b660405190565b9283928362000580565b0390a190565b620006e2906000620006d9818362000116565b810190620002cf565b3862000683565b62000531565b60405163d1c8af3760e01b8152600490fd5b906200072962000739620000b09362000718600090565b50604051928391602083016200051e565b6020820181038252038262000116565b6200074d62000746825190565b9160200190565b209060206200076382516001600160a01b031690565b929101519162000794565b620000b0620000b0620000b09290565b620000b060016200076e565b620000b06200077e565b91620007a083620007db565b15620007b457620000b092919091620008f2565b620000b092919091620007fa565b620007d2620000b0620000b09290565b63ffffffff1690565b3b620007f6620007ec6000620007c2565b9163ffffffff1690565b1190565b9162000819620005bc91620008269362000812600090565b50620009e6565b926001600160a01b031690565b1490565b6001600160e01b0319811662000161565b90505190620000bf826200082a565b906020828203126200008157620000b0916200083b565b60005b838110620008755750506000910152565b818101518382015260200162000864565b620008ab6200048160209362000196936200089f815190565b80835293849260200190565b9586910162000861565b908152604060208201819052620000b09291019062000886565b620008e5620008df620000b09290565b60e01b90565b6001600160e01b03191690565b916200090f6200062d6020939462000908600090565b506200055e565b62000936631626ba7e949294620009426200092960405190565b9687958694859460e01b90565b845260048401620008b5565b03915afa908115620006e95760009162000979575b50620008266200096b631626ba7e620008cf565b916001600160e01b03191690565b6200099f915060203d8111620009a6575b62000996818362000116565b8101906200084a565b3862000957565b503d6200098a565b620009e2620000bf94620009db606094989795620009d1608086019a6000870152565b60ff166020850152565b6040830152565b0152565b60209160009162000a16848301519260606040820151910151851a9362000a0c60405190565b94859485620009ae565b838052039060015afa15620006e9576000519056fe60806040523462000030576200001e620000186200022d565b62000506565b6040516103f36200053a82396103f390f35b600080fd5b634e487b7160e01b600052604160045260246000fd5b90601f01601f191681019081106001600160401b038211176200006d57604052565b62000035565b906200008a6200008260405190565b92836200004b565b565b6001600160a01b031690565b90565b6001600160a01b038116036200003057565b905051906200008a826200009b565b6001600160401b0381116200006d57602090601f01601f19160190565b60005b838110620000ed5750506000910152565b8181015183820152602001620000dc565b90929192620001176200011182620000bc565b62000073565b9381855260208501908284011162000030576200008a92620000d9565b9080601f83011215620000305781516200009892602001620000fe565b91909160608184031262000030576200016b606062000073565b92620001788183620000ad565b845260208201516001600160401b0381116200003057816200019c91840162000134565b602085015260408201516001600160401b0381116200003057620001c1920162000134565b6040830152565b9190916060818403126200003057620001e2606062000073565b81519093906001600160401b0381116200003057816200017891840162000151565b90602082820312620000305781516001600160401b0381116200003057620000989201620001c8565b620000986200092d80380380620002448162000073565b92833981019062000204565b906001600160a01b03905b9181191691161790565b62000098906200008c906001600160a01b031682565b620000989062000265565b62000098906200027b565b90620002a562000098620002ad9262000286565b825462000250565b9055565b634e487b7160e01b600052602260045260246000fd5b9060016002830492168015620002ea575b6020831014620002e457565b620002b1565b91607f1691620002d8565b9160001960089290920291821b911b6200025b565b6200009862000098620000989290565b91906200032f62000098620002ad936200030a565b908354620002f5565b6200008a916000916200031a565b81811062000352575050565b8062000362600060019362000338565b0162000346565b9190601f81116200037957505050565b6200038d6200008a93600052602060002090565b906020601f840181900483019310620003b1575b6020601f90910104019062000346565b9091508190620003a1565b90620003c6815190565b906001600160401b0382116200006d57620003ee82620003e78554620002c7565b8562000369565b602090601f83116001146200042d57620002ad92916000918362000421575b5050600019600883021c1916906002021790565b0151905038806200040d565b601f198316916200044385600052602060002090565b9260005b81811062000484575091600293918560019694106200046a575b50505002019055565b01516000196008601f8516021c1916905538808062000461565b9193602060018192878701518155019501920162000447565b906200008a91620003bc565b6200008a9190620004ec90604090600290620004d881620004d187516001600160a01b031690565b9062000291565b620004f360018201620004ec602088015190565b906200049d565b0192015190565b906200008a91620004a9565b80516200008a916040916200051d906000620004fa565b60208101516200052f9060036200049d565b015160046200049d56fe6080604052600436101561001257600080fd5b60003560e01c806354fd4d50146100325763fbbf93a00361004257610144565b610049565b600091031261004257565b600080fd5b565b3461004257610059366004610037565b610074610064610182565b6040519182918290815260200190565b0390f35b90565b60005b83811061008e5750506000910152565b818101518382015260200161007e565b6100bf6100c86020936100d2936100b3815190565b80835293849260200190565b9586910161007b565b601f01601f191690565b0190565b80516001600160a01b03168252610078916040610103606083015b6020850151848203602086015261009e565b92015190604081840391015261009e565b805160608084526100789391604091610103916100f1918501906100d6565b602080825261007892910190610114565b3461004257610154366004610037565b61007461015f6103aa565b60405191829182610133565b6100786100786100789290565b610078600161016b565b610078610178565b634e487b7160e01b600052604160045260246000fd5b90601f01601f1916810190811067ffffffffffffffff8211176101c257604052565b61018a565b906100476101d460405190565b92836101a0565b61007860606101c7565b6101ed6101db565b90602080808460005b81520160608152016060905250565b6100786101e5565b6102156101db565b9060208080846101f6610205565b61007861020d565b634e487b7160e01b600052602260045260246000fd5b9060016002830492168015610261575b602083101461025c57565b61022b565b91607f1691610251565b8054600093929161028861027e83610241565b8085529360200190565b91600181169081156102da57506001146102a157505050565b6102b49192939450600052602060002090565b916000925b8184106102c65750500190565b8054848401526020909301926001016102b9565b92949550505060ff1916825215156020020190565b906100789161026b565b906100476103139261030a60405190565b938480926102ef565b03836101a0565b90610047610369600261032b6101db565b9461034d61034082546001600160a01b031690565b6001600160a01b03168752565b61036361035c600183016102f9565b6020880152565b016102f9565b6040840152565b9061004761036960046103816101db565b9461039261038e8261031a565b8752565b61036361035c600383016102f9565b61007890610370565b6103b2610223565b5061007860006103a156fea26469706673582212203299673a482c73b0fbaf71157459136452a2353563f892899bfd21f6f982d2bc64736f6c63430008180033a2646970667358221220168eca03aa4504411acfcce54da63aeb31a8cc76fbb38a9537bf7da18aac4f3864736f6c63430008180033
Verified Source Code Full Match
Compiler: v0.8.24+commit.e11b9ed9
EVM: paris
RicardianTriplerBORGParticipation.sol 125 lines
//SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.18;
import "./SignatureValidator.sol";
/// @author MetaLeX Labs, Inc.
interface IBORGParticipationRegistry {
function recordAdoption(address adoptingParty, address agreementDetailsAddress) external;
}
///
/// STRUCTS AND TYPES
///
/// @notice the details of an account in an agreement
struct Account {
// The address of the account (EOA or smart contract)
address accountAddress;
// The signature of the account. Optionally used to verify that this account has signed hashed agreement details
bytes signature;
}
/// @notice the details of the agreement, consisting of all necessary information to deploy a BORGParticipation contract and the legal agreement information
struct AgreementDetails {
/// @notice The `Party` struct details of the party adopting the agreement
Party adoptingParty;
/// @notice string name of the applicable BORG
string BORGName;
/// @notice IPFS hash of the official MetaLeX BORG Participation Agreement version being agreed to which confirms all terms, and may contain a unique interface identifier
string legalAgreementURI;
}
/// @notice details of a party: address, name, and contact information
struct Party {
/// @notice The blockchain address of the party to be used in the BORG multisig(s)
address partyBlockchainAddy;
/// @notice The name of the party adopting the agreement
string partyName;
/// @notice The contact details of the party (required for legal notifications under the agreement)
string contactDetails;
}
///
/// CONTRACTS
///
/// @notice Contract that contains the BORG Participation agreement details that will be deployed by the Agreement Factory.
contract RicardianTriplerBORGParticipation {
uint256 internal constant AGREEMENT_VERSION = 1;
/// @notice The details of the agreement; accessible via `getDetails`
AgreementDetails internal details;
/// @notice Constructor that sets the details of the agreement.
/// @param _details the `AgreementDetails` struct containing the details of the agreement.
constructor(AgreementDetails memory _details) {
details.adoptingParty = _details.adoptingParty;
details.BORGName = _details.BORGName;
details.legalAgreementURI = _details.legalAgreementURI;
}
/// @notice Function that returns the version of the agreement.
function version() external pure returns (uint256) {
return AGREEMENT_VERSION;
}
/// @notice Function that returns the details of the agreement.
/// @dev view function necessary to convert storage to memory automatically for the nested structs.
/// @return `AgreementDetails` struct containing the details of the agreement.
function getDetails() external view returns (AgreementDetails memory) {
return details;
}
}
/// @notice Factory contract that creates a new RicardianTriplerBORGParticipation contract if adopted properly, and records adoption in the BORGParticipationRegistry.
/// @dev various events emitted in the `registry` contract
contract AgreementV1Factory is SignatureValidator {
uint256 internal constant FACTORY_VERSION = 1;
/// @notice The BORGParticipationRegistry contract.
address public registry;
error RicardianTriplerBORGParticipation_NotParty();
/// @notice event that fires if an address adopts a new RicardianTriplerBORGParticipation contract
event RicardianTriplerBORGParticipation_Adopted(address adoptingParty, address agreementAddress);
/// @notice Constructor that sets the BORGParticipationRegistry address.
/// @dev no access control necessary as valid factories are set by the `admin` in the `registry` contract
/// @param registryAddress The address of the BORGParticipationRegistry contract.
constructor(address registryAddress) {
registry = registryAddress;
}
/// @notice creates a new RicardianTriplerBORGParticipation contract and records its adoption in the BORGParticipationRegistry if called by the `details.adoptingParty.partyBlockchainAddy`
/// @param details `AgreementDetails` struct of the agreement details which will be hashed to ensure same parameters as the proposed agreement
function adoptBORGParticipationAgreement(AgreementDetails calldata details) external returns (address) {
if (msg.sender != details.adoptingParty.partyBlockchainAddy)
revert RicardianTriplerBORGParticipation_NotParty();
RicardianTriplerBORGParticipation agreementDetails = new RicardianTriplerBORGParticipation(details);
address _agreementAddress = address(agreementDetails);
IBORGParticipationRegistry(registry).recordAdoption(msg.sender, _agreementAddress);
emit RicardianTriplerBORGParticipation_Adopted(msg.sender, _agreementAddress);
return (_agreementAddress);
}
/// @notice validate that an `account` has signed the hashed agreement details
/// @param details `AgreementDetails` struct of the agreement details to which `account` is being validated as signed
/// @param account `Account` struct of the account which is being validated as having signed `details`
function validateAccount(AgreementDetails calldata details, Account memory account) external view returns (bool) {
bytes32 hash = keccak256(abi.encode(details));
// Verify that the account's accountAddress signed the hashed details.
return isSignatureValid(account.accountAddress, hash, account.signature);
}
/// @notice Function that returns the version of the agreement factory.
function version() external pure returns (uint256) {
return FACTORY_VERSION;
}
}
SignatureValidator.sol 84 lines
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.20;
interface IERC1271 {
function isValidSignature(
bytes32 hash,
bytes memory signature
) external view returns (bytes4);
}
contract SignatureValidator {
/// @notice Returns the signer of a hash.
/// @param hash The unsigned hash.
/// @param signature The signature.
/// @return signer The signer of the hash.
function recoverSigner(
bytes32 hash,
bytes memory signature
) internal pure returns (address signer) {
uint8 v;
bytes32 r;
bytes32 s;
assembly {
r := mload(add(signature, 32))
s := mload(add(signature, 64))
v := byte(0, mload(add(signature, 96)))
}
return ecrecover(hash, v, r, s);
}
/// @notice Returns whether an EOA signed a given hash.
/// @param wantSigner The signer to check for.
/// @param hash The hash that was signed.
/// @param signature The signature.
function isEOASignatureValid(
address wantSigner,
bytes32 hash,
bytes memory signature
) internal pure returns (bool) {
address signer = recoverSigner(hash, signature);
return signer == wantSigner;
}
/// @notice Returns whether a contract signed a given hash.
/// @param wantSigner The signer to check for.
/// @param hash The hash that was signed.
/// @param signature The signature.
function isContractSignatureValid(
address wantSigner,
bytes32 hash,
bytes memory signature
) internal view returns (bool) {
bytes4 result = IERC1271(wantSigner).isValidSignature(hash, signature);
return result == 0x1626ba7e;
}
/// @notice Returns whether an address is a contract.
/// @param addr The address to check.
function isContract(address addr) internal view returns (bool) {
uint32 size;
assembly {
size := extcodesize(addr)
}
return (size > 0);
}
/// @notice Returns whether a signature is valid.
/// @param wantSigner The signer to check for.
/// @param hash The hash that was signed.
/// @param signature The signature.
function isSignatureValid(
address wantSigner,
bytes32 hash,
bytes memory signature
) public view returns (bool) {
if (isContract(wantSigner)) {
return isContractSignatureValid(wantSigner, hash, signature);
} else {
return isEOASignatureValid(wantSigner, hash, signature);
}
}
}
Read Contract
isSignatureValid 0xfd746e43 → bool
registry 0x7b103999 → address
validateAccount 0xb8880432 → bool
version 0x54fd4d50 → uint256
Write Contract 1 functions
These functions modify contract state and require a wallet transaction to execute.
adoptBORGParticipationAgreement 0x1e2e9d5e
tuple details
returns: address
Recent Transactions
No transactions found for this address