Discover more of Etherscan's tools and services in one place.
Sponsored
Contract Source Code:
File 1 of 1 : RoyaltySplitter
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; contract RoyaltySplitter { event Deposit(address sender, uint256 amount); address user1; address user2; uint256 user1Fraction; constructor( address u1, address u2, uint256 fraction ) { user1 = u1; user2 = u2; user1Fraction = fraction; } receive() external payable { emit Deposit(msg.sender, msg.value); } function withdraw() external { require( msg.sender == user1 || msg.sender == user2, "Only user1 or user2 can withdraw" ); uint256 u1total = (address(this).balance * user1Fraction) / 100; (bool success, ) = user1.call{value: u1total}(""); require(success, "failed to receive ether"); (success, ) = user2.call{value: address(this).balance}(""); require(success, "failed to receive ether"); } }
Please enter a contract address above to load the contract details and source code.
Please DO NOT store any passwords or private keys here. A private note (up to 100 characters) can be saved and is useful for transaction tracking.
This website uses cookies to improve your experience. By continuing to use this website, you agree to its Terms and Privacy Policy.