Proton Contract

Proton contract, the standard ERC721 token of the protocol. All Protons are Particles.

Get Proton Info

Get a Proton's creator, sale price, etc.

creatorOf

Gets the creator of a Proton.

function creatorOf(
  uint256 tokenId
) external view virtual override returns (address);

getSalePrice

Gets current sale price of a Proton in Ether.

function getSalePrice(uint256 tokenId) 
  external 
  view
  virtual
  override
  returns (uint256);

getLastSellPrice

Gets most recent price that Proton sold for in Ether.

function creatorOf(uint256 tokenId) 
  external
  view
  virtual
  override
  returns (address);

getCreatorRoyalties

Gets creator royalties for a given creator address. Royalties are how much of the sale price will be directed to the Proton's creator whenever a Proton is sold.

function getCreatorRoyalties(
  address account
) external view virtual override returns (uint256);

getCreatorRoyaltiesPct

Gets creator royalties for a given tokenId. Royalties are how much of the sale price will be directed to the Proton's creator whenever a Proton is sold.

function getCreatorRoyaltiesPct(
  uint256 tokenId
) external view virtual override returns (uint256);

getCreatorRoyaltiesReceiver

Gets creator royalties receiver. Can be either the creator or a 3rd-party, such as a charity, relative, or any other account of choice.

function getCreatorRoyaltiesReceiver(
  uint256 tokenId
) external view virtual override returns (address);

Create & Interact with Proton(s)

Create various types of Protons, buy a Proton, claim royalties, etc.

claimCreatorRoyalties

Sends royalties to creator or delegated receiver.

function claimCreatorRoyalties() 
  external 
  virtual
  override
  nonReentrant
  whenNotPaused
  returns (uint256)

createChargedParticle

Create a new Charged Particle (a Proton with interest-bearing assets deposited into its wallet).

function createChargedParticle(
  address creator,
  address receiver,
  address referrer,
  string tokenMetaUri,
  string walletManagerId,
  address assetToken,
  uint256 assetAmount, 
  uint256 annuityPercent
) external virtual override nonReentrant whenNotPaused returns (uint256 newTokenId);

createBasicProton

Create a basic Proton without charge, and with annuityPercent, royaltiesPercent, and salePrice set to 0.

function createBasicProton(
  address creator,
  address receiver,
  string tokenMetaUri
) external virtual override whenNotPaused returns (uint256 newTokenId);

createProton

Create a Proton, set its annuity percentage to a custom amount, and set royalties percentage and salePrice to 0.

function createProton(
  address creator,
  address receiver,
  string tokenMetaUri,
  uint256 annuityPercent
) external virtual override whenNotPaused returns (uint256 newTokenId);

createProtonForSale

function createProtonForSale(
  address creator,
  address receiver,
  string tokenMetaUri,
  uint256 annuityPercent,
  uint256 royaltiesPercent,
  uint256 salePrice
) external virtual override whenNotPaused returns (uint256 newTokenId);

batchProtonsForSale

function batchProtonsForSale(
  address creator,
  uint256 annuityPercent,
  uint256 royaltiesPercent,
  string[] calldata tokenMetaUris,
  uint256[] calldata salePrices
) external virtual override whenNotPaused;

buyProton

Buy a Proton.

function buyProton(
  uint256 tokenId
) external payable virutal override nonReentrant whenNotPaused returns (bool);

Update Proton Settings (Only for Creator/Owner)

Set a Protons Price, Royalties, or Royalties Receiver.

setSalePrice

Set the sale price for a Proton.

function setSalePrice(
  uint256 tokenId, 
  uint256 salePrice
) external virtual override whenNotPaused onlyTokenOwnerOrApproved(tokenId);

setRoyaltiesPct

Set royalties percentage for a Proton.

function setRoyaltiesPct(
  uint256 tokenId,
  uint256 royaltiesPct
) external virtual override whenNotPaused onlyTokenCreator(tokenId) onlyTokenOwnerOrApproved(tokenId);

setCreatorRoyaltiesReceiver

Set a receiver for Proton royalties.

function setCreatorRoyaltiesReceiver(
  uint256 tokenId, 
  address receiver
) external virtual override whenNotPaused onlyTokenCreator(tokenId);

Other

Events

UniverseSet

event UniverseSet(address indexed universe);

ChargedStateSet

event ChargedStateSet(address indexed chargedState);

ChargedSettingsSet

event ChargedSettingsSet(address indexed chargedSettings);

ChargedParticlesSet

event ChargedParticlesSet(address indexed chargedParticles);

PausedStateSet

event PausedStateSet(bool isPaused);

SalePriceSet

event SalePriceSet(uint256 indexed tokenId, uint256 salePrice);

CreatorRoyaltiesSet

event CreatorRoyaltiesSet(uint256 indexed tokenId, uint256 royaltiesPct);

FeesWithdrawn

event FeesWithdrawn(address indexed receiver, uint256 amount);

ProtonSold

event ProtonSold(
  uint256 indexed tokenId,
  address indexed oldOwner,
  address indexed newOwner,
  uint256 salePrice,
  address creator, 
  uint256 creatorRoyalties
);

RoyaltiesClaimed

event RoyaltiesClaimed(address indexed receiver, uint256 amountClaimed);

Last updated