View Source: contracts/drafts/SignatureBouncer.sol
↗ Extends: SignerRole ↘ Derived Contracts: SignatureBouncerMock
SignatureBouncer
A method that uses the onlyValidSignatureAndData
modifier must make
the _signature parameter the "last" parameter. You cannot sign a message that
has its own signature in it so the last 128 bytes of msg.data (which
represents the length of the _signature data and the _signaature data itself)
is ignored when validating. Also non fixed sized parameters make constructing
the data in the signature much more complex.
See https://ethereum.stackexchange.com/a/50616 for more details.
Constants & Variables
uint256 private constant _METHOD_ID_SIZE;
uint256 private constant _SIGNATURE_SIZE;
requires that a valid signature of a signer was provided
modifier onlyValidSignature(bytes signature) internal
Arguments
Name | Type | Description |
---|---|---|
signature | bytes |
requires that a valid signature with a specifed method of a signer was provided
modifier onlyValidSignatureAndMethod(bytes signature) internal
Arguments
Name | Type | Description |
---|---|---|
signature | bytes |
requires that a valid signature with a specifed method and params of a signer was provided
modifier onlyValidSignatureAndData(bytes signature) internal
Arguments
Name | Type | Description |
---|---|---|
signature | bytes |
- _isValidSignature(address account, bytes signature)
- _isValidSignatureAndMethod(address account, bytes signature)
- _isValidSignatureAndData(address account, bytes signature)
- _isValidDataHash(bytes32 hash, bytes signature)
is the signature of this + sender
from a signer?
function _isValidSignature(address account, bytes signature) internal
returns(bool)
Returns
bool
Arguments
Name | Type | Description |
---|---|---|
account | address | |
signature | bytes |
is the signature of this + sender + methodId
from a signer?
function _isValidSignatureAndMethod(address account, bytes signature) internal
returns(bool)
Returns
bool
Arguments
Name | Type | Description |
---|---|---|
account | address | |
signature | bytes |
the signature parameter of the method being validated must be the "last" parameter
function _isValidSignatureAndData(address account, bytes signature) internal
returns(bool)
Returns
bool
Arguments
Name | Type | Description |
---|---|---|
account | address | |
signature | bytes |
internal function to convert a hash to an eth signed message and then recover the signature and check it against the signer role
function _isValidDataHash(bytes32 hash, bytes signature) internal
returns(bool)
Returns
bool
Arguments
Name | Type | Description |
---|---|---|
hash | bytes32 | |
signature | bytes |
- Address
- AddressImpl
- AllowanceCrowdsale
- AllowanceCrowdsaleImpl
- Arrays
- ArraysImpl
- CappedCrowdsale
- CappedCrowdsaleImpl
- CapperRole
- CapperRoleMock
- ConditionalEscrow
- ConditionalEscrowMock
- Counter
- CounterImpl
- Crowdsale
- CrowdsaleMock
- ECDSA
- ECDSAMock
- ERC165
- ERC165Checker
- ERC165CheckerMock
- ERC165InterfacesSupported
- ERC165Mock
- ERC165NotSupported
- ERC20
- ERC20Burnable
- ERC20BurnableMock
- ERC20Capped
- ERC20Detailed
- ERC20DetailedMock
- ERC20FailingMock
- ERC20Migrator
- ERC20Mintable
- ERC20MintableMock
- ERC20Mock
- ERC20Pausable
- ERC20PausableMock
- ERC20SucceedingMock
- ERC20TokenMetadata
- ERC20WithMetadata
- ERC20WithMetadataMock
- ERC721
- ERC721Burnable
- ERC721Enumerable
- ERC721Full
- ERC721FullMock
- ERC721Holder
- ERC721Metadata
- ERC721MetadataMintable
- ERC721Mintable
- ERC721MintableBurnableImpl
- ERC721Mock
- ERC721Pausable
- ERC721PausableMock
- ERC721ReceiverMock
- Escrow
- EventEmitter
- FinalizableCrowdsale
- FinalizableCrowdsaleImpl
- IERC165
- IERC20
- IERC721
- IERC721Enumerable
- IERC721Full
- IERC721Metadata
- IERC721Receiver
- IncreasingPriceCrowdsale
- IncreasingPriceCrowdsaleImpl
- IndividuallyCappedCrowdsale
- IndividuallyCappedCrowdsaleImpl
- Math
- MathMock
- MerkleProof
- MerkleProofWrapper
- MintedCrowdsale
- MintedCrowdsaleImpl
- MinterRole
- MinterRoleMock
- Ownable
- OwnableMock
- Pausable
- PausableMock
- PauserRole
- PauserRoleMock
- PaymentSplitter
- PostDeliveryCrowdsale
- PostDeliveryCrowdsaleImpl
- PullPayment
- PullPaymentMock
- ReentrancyAttack
- ReentrancyGuard
- ReentrancyMock
- RefundableCrowdsale
- RefundableCrowdsaleImpl
- RefundEscrow
- Roles
- RolesMock
- SafeERC20
- SafeERC20Helper
- SafeMath
- SafeMathMock
- SampleCrowdsale
- SampleCrowdsaleToken
- Secondary
- SecondaryMock
- SignatureBouncer
- SignatureBouncerMock
- SignerRole
- SignerRoleMock
- SimpleToken
- SupportsInterfaceWithLookupMock
- TimedCrowdsale
- TimedCrowdsaleImpl
- TokenTimelock
- TokenVesting